home *** CD-ROM | disk | FTP | other *** search
/ Danny Amor's Online Library / Danny Amor's Online Library - Volume 1.iso / html / faqs / faq / usl-bugs < prev    next >
Text File  |  1995-07-25  |  87KB  |  2,109 lines

  1. Subject: Known Bugs in the USL UNIX distribution
  2. Newsgroups: comp.unix.sys5.r4,comp.unix.pc-clone.32bit,comp.bugs.sys5,news.answers
  3. From: esr@snark.thyrsus.com (Eric S. Raymond)
  4. Date: 5 Aug 93 16:27:16 GMT
  5.  
  6. Archive-name: usl-bugs
  7. Last-update: 05 Aug 1993
  8. Supersedes: <unknown>
  9. Version: 17.0
  10.  
  11. Many FAQs, including this one, are available via FTP on the archive site
  12. rtfm.mit.edu (aka pit-manager.mit.edu or 18.172.1.27) in the directory
  13. pub/usenet/news.answers.  The name under which this FAQ is archived appears in
  14. the Archive-name line above.  This FAQ is updated monthly; if you want the
  15. latest version, please query the archive rather than emailing the overworked
  16. maintainer.
  17.  
  18. What's new in this issue:
  19.    * New bug info (see below)
  20.    * Instructions for fixing the FUBYTE problem under Del 2.2.
  21.  
  22. *** NEWS FLASH *** NEWS FLASH *** NEWS FLASH *** NEWS FLASH *** NEWS FLASH ***
  23.  
  24.   May's new bug (II.43) is still *really serious*.  Get after your
  25. vendor to fix it ASAP!
  26.  
  27. *** NEWS FLASH *** NEWS FLASH *** NEWS FLASH *** NEWS FLASH *** NEWS FLASH ***
  28.  
  29. (In the table below, bugs new this issue are marked with a ** at the
  30. left margin; old bugs for which information has been added are marked
  31. with *)
  32.  
  33. 0. Table of Contents
  34. I. Introduction
  35. II. General Bugs
  36.     1. UNIX kernel must lie below the 1024-cylinder mark
  37.     2. Suid programs dump core when signalled
  38.     3. DMAs on large ISA machines may fail
  39.     4. There is a cylinder limit on disk size
  40.     5. more(1) doesn't handle SIGWINCH
  41.     6. X performance problem
  42.     7. C shell background process termination logs you out
  43.     8. A security hole in login
  44.     9. COFF problems with long filenames
  45.     10. Flakeouts in the Wangtek device driver
  46.     11. A kernel declaration bug
  47.     12. Reading tar archives with cpio foos up on multiply-linked files
  48.     13. Process accounting is broken
  49.     14. tar(1) foos up in the presence of symbolic links
  50.     15. Symbolic links can interfere with shellscript execution
  51.     16. Piping a csh builtin causes the shell to hang.
  52.     17. tar(1) fails to restore adjacent symbolic links properly
  53.     18. COFF binaries linked with curses(3) and shared libc hang
  54.     19. shl hangs, sxt devices bad
  55.     20. num-lock prevents mouse from working properly
  56.     21. adjtime() doesn't work
  57.     23. cron mail doesn't go through aliasing
  58.     24. fragility in xterm
  59.     25. csh lossage due to bad optimization
  60.     26. Bug in cp(1)
  61.     27. tbl -me doesn't work
  62. *   28. who -r fragility leads to boot-time problems
  63.     29. at(1) breaks here-documents in shell scripts
  64.     30. UHC mouse driver ignores the middle button.
  65.     31. mmap acces doesn't update file mod times
  66.     32. AT&T select(2) is incompatible with BSD select(2)
  67.     33. (4.2) The login program requires its PPID to be 1
  68.     34. (4.2) Bad MAXMINOR values can make the system unbootable
  69.     35. Incompatible change in TZ interpretation
  70.     36. Nulls in pixmaps can crash X
  71.     37. Potential security hole in SVr4s using sendmail
  72.     38. Reporting bug in df on non-root filesystems
  73.     39. tar writes -v output to stdout, not stderr
  74.     40. SIGPIPE is delayed and not reliable
  75.     41. /usr/lib/acct/fwtmp doesn't work
  76.     42. whatis database is full of garbage.
  77.     43. mmap is seriously broken
  78. **  44. a bug in xterm
  79. **  45. DrawText16() bug in XWIN
  80. **  46. output redirection with exec fails in sh
  81. **  47. rm fails to reject . or .. arguments
  82. III. Serial-port and tty administration problems
  83.     1. Dropout problems with tty devices
  84.     2. Quick port setup option in sysadm is broken
  85.     3. ttymon drops DTR when it shouldn't
  86.     4. ttymon doesn't drop DTR when it should
  87.     5. (4.2) Terminating cu to a direct line locks up the port
  88. *   6. Hardware flow control bug breaks streaming data transfers
  89.     7. Bad interaction between ttymon and networking
  90. IV. Networking and File-Sharing Bugs
  91.     1. NFS locking is unusably slow
  92.     2. UFS file system problems
  93.     3. Byte-order problem with NFS when accessing Sun disks
  94.     4. Under weird circumstances, lseek on UFS may cause corruption
  95.     5. FTP problems
  96.     6. A bug in the WD80x3 support
  97.     7. Security hole near fingerd
  98.     8. Fatal bug in priority-band message handling.
  99.     9. SVr4.0.4 TCP/IP routing is broken
  100.     10. df(1) on NFS volumes returns bad data
  101.     11. rsh hogs the processor
  102. **  12. MTU for remote networks ignored
  103. **  13. Bug in remote printing.
  104. V. SCSI Support Problems
  105.     1. sar is confused by SCSI
  106.     2. A configuration problem
  107.     3. Synchronous SCSI hang problem
  108.     4. ps chokes on commands that do SCSI I/O
  109.     5. Transfer speed problems with Adaptec 1542B on 486s
  110.     6. df gives inaccurate values for large SCSI partitions
  111. VI. Development Tools Problems
  112.     1. General UCB library brokenness
  113.     2. USL emulation of BSD signals doesn't work
  114.     3. Possible string library problems
  115.     4. USL's ndbm support is broken.
  116.     5. An include file is missing
  117.     6. sscanf(3) has a potential bug
  118.     7. shmat(2) vs. vfork(2)
  119.     8. FIONREAD fails on regular files
  120.     9. fread(3) does the wrong thing on pipes and FIFOs
  121.     10. putw appears to be broken
  122.     11. Compiler problems
  123.     12. getlogin() doesn't work
  124.     13. syslog routines don't work
  125.     14. Bogus `r' in xt driver configuration flags
  126.     15. ioctl for kernel symbol fetches fails (4.2)
  127. **  16. Bug in cc optimizer (4.2.1)
  128. **  17. /usr/ucb/install uses missing group "staff"
  129. VII. The FUBYTE Problem *
  130. VIII. Destiny and Dell
  131.  
  132. I. Introduction
  133.  
  134. This posting lists known bugs in System V Release 4 implementations, and known
  135. fixes applied by various porting houses (there's also random bits of
  136. information about SCO UNIX here and there).  It was formerly part of the
  137. 386-buyers-faq issues 1.0 through 4.0, and is still best read in conjunction
  138. with the pc-unix/software FAQ descended from that posting.
  139.  
  140. This document is maintained and periodically updated as a service to the net by
  141. Eric S.  Raymond <esr@snark.thyrsus.com>, who began it for the very best
  142. self-interested reason that he was in the market and didn't believe in plonking
  143. down several grand without doing his homework first (no, I don't get paid for
  144. this, though I have had a bunch of free software and hardware dumped on me as a
  145. result of it!).  Corrections, updates, and all pertinent information are
  146. welcomed at that address.
  147.  
  148. This posting is periodically broadcast to the USENET group comp.unix.sysv386
  149. and to a list of vendor addresses.  If you are a vendor representative, please
  150. check to make sure the information on your company is current and correct.  If
  151. it is not, please email me a correction ASAP.  If you are a knowledgeable user
  152. of any of these products, please send me a precis of your experiences for the
  153. improvement of future issues.
  154.  
  155. The bug descriptions often include indications of fixes by the various porting
  156. houses to their current releases.  These are:
  157.  
  158. Consensys UNIX Version 1.3            abbreviated as "Cons" below
  159. Dell UNIX Issue 2.2                abbreviated as "Dell" below
  160. Esix Revision A                    abbreviated as "Esix" below
  161. Micro Station Technology SVr4 UNIX        abbreviated as "MST" below
  162. Microport System V Release 4.0 version 4    abbreviated as "uPort" below
  163. UHC Version 3.6                    abbreviated as "UHC" below
  164. SCO Open DeskTop 1.1                abbreviated as "SCO" below
  165.  
  166. II. General Bugs
  167.  
  168. 1. UNIX kernel must lie below the 1024-cylinder mark
  169.    Bela Lubkin says "SCO's boot filesystem must lie below 1024 cylinder mark;
  170. anything else can be anywhere.  This is more-or-less a limitation of the BIOS
  171. interface that the bootstrap loader must use.  Could be circumvented by going
  172. directly to controller hardware in the bootstrap loader, but that would be
  173. horrendously complex with all the controllers & host adapters to be supported."
  174.    Actually this is not quite right.  It's the *kernel* that must lie below
  175. the 1K-cylinder mark; the rest of the root partition could extend above it.
  176. But since partition endpoints are the only way to control where physical
  177. blocks get allocated, it comes to the same thing
  178.    Roger Knopf <rogerk@sco.COM> adds: "The 1024 cylinder limit applies
  179. not only to the kernel but also to /boot. Both are read in while we
  180. are using the BIOS to talk to the hard disk. There are 10 bits set
  181. aside in the register for cylinders in the INT 13 call, hence 1024
  182. cylinders. There are a few controllers that allocate 2 more bits (they
  183. are taken away from the space allocated for head bits, I recall). It
  184. is trivial to modify all the relevant boot code to use these bits IF
  185. YOU KNOW THAT THE CONTROLLER WILL USE THEM but I know of no way to
  186. reliably determine that this is the case.  Once the kernel is loaded
  187. we use 16 bits everywhere to hold the cylinder number."
  188.  
  189. 2. Suid programs dump core when signalled
  190.    Mark Snitily of SGCS says that under many SVr4s, signalling a
  191. process that is running suid root will cause it to core-dump.  He says
  192. Dell and MST have fixed this, and SCO doesn't suffer from this.
  193.  
  194. 3. DMAs on large ISA machines may fail
  195.    On ISA machines with more that 16MB of RAM, SVr4 may try to do DMA
  196. from outside the bus's address space, causing serious problems.  UNIX ought
  197. to do an in-memory copy to within the low 16MB but the USL base code doesn't.
  198.    Dell says they've fixed this, and that's been confirmed by a user.
  199.    UHC says they've fixed this; they add that the special buffer-allocation
  200. logic to handle the problem can be turned off with a tunable kernel parameter
  201. if you've got less than 16M.
  202.    Microport says they've fixed this in their new 4.1 release, shipping early
  203. March.
  204.    Esix offers a patch to correct this problem.
  205.    SCO used to have a similar bug but fixed it long ago.
  206.    John Sully <jms@mport.com> writes: "This was due to a bug in pre version 4
  207. dma code.  The USL code has always at least attempted to do a copy from low
  208. memory to high memory on systems with more than 16Mb of RAM.  By the way UHC is
  209. wrong; the buffer allocation code only comes into play if you have more than
  210. 16Mb of memory.  You can turn it off if you have a machine (ie. an EISA bus)
  211. which will allow you to do DMA above 16Mb.  You *must* have this tunable
  212. (MAXDMAPAGE) turned on if you are using *ISA* bus masters in a system with more
  213. than 16Mb of ram.  Unfortunately doing this will affect all drivers which do
  214. dma as there is no good way to do this on a per-driver basis."
  215.  
  216. 4. There is a cylinder limit on disk size
  217.    Stock USL code is limited to 1,024 cylinders per Winchester, which
  218. might cause problems with some disk drives.
  219.    Microport, Dell, Esix, MST, and UHC have fixed this.
  220.  
  221. 5. more(1) doesn't handle SIGWINCH
  222.    It doesn't get its window size from the stty/termio structures, so it
  223. doesn't cope with SIGWINCH properly.
  224.  
  225. 6. X performance problem
  226.    Stock X11R4 and R5 (at least prior to 1.2E) is said to hog the
  227. processor if you use the LOCALCONNECT option.  Jan Brittenson
  228. <bson@gnu.ai.mit.edu> posted the following workaround:
  229.  
  230.    I don't know what causes the standard X server to hog the CPU, but
  231. it can be avoided. Use the following program instead of xinit. Compile
  232. it with `$CC -O -o xserv xserv.c -lX11' where CC is either
  233. /usr/ccs/bin/cc or gcc. Set DISPLAY and XINITRC and run `xserv' from
  234. your home directory. This is just a q&d hack, and not really a
  235. substitute for xinit -- but it works.
  236.  
  237. /* xserv.c -- start X server
  238.  
  239.    Start X server. Similar to xinit, but intended to
  240.    circumvent the X386 CPU Hog Mode
  241.  
  242.    Jan Brittenson, June 2 1992  05:15 am
  243.    with corrections by Adam Donnison <adam@shinto.saki.com.au> Tue, 2 Mar 1993
  244. */
  245.  
  246. #include <stdio.h>
  247. #include <sys/types.h>
  248. #include <signal.h>
  249. #include <setjmp.h>
  250. #include <unistd.h>
  251. #include <libgen.h>
  252.  
  253. #include <X11/Xlib.h>
  254. #include <X11/Xos.h>
  255. #include <X11/Xmu/SysUtil.h>
  256.  
  257.  
  258. extern int errno;
  259.  
  260. /* This may need to be "/usr/X386/bin/X386" */
  261. #define DEFAULT_XPATH "/usr/bin/X11/X"
  262.  
  263. /* Start X server. Fork-exec server, passing the DISPLAY environment
  264.    variable. Wait for server to get up and running (at which point it
  265.    passes back a SIGUSR1), at which point the user xinitrc file is run. */
  266.  
  267. #define XINITRC ".xinitrc"
  268. #define DEFAULT_XCOMMAND "xterm -g +1+1 -n login -display :0"
  269.  
  270. extern void *malloc (), free ();
  271. extern char *basename (), *getenv (), *strcpy ();
  272.  
  273. /* X stuff */
  274. Display *top_display;
  275.  
  276.  
  277. /* This is supposed to be in libgen.a... */
  278. static char
  279. *basename (s0)
  280.   char *s0;
  281. {
  282.   register char *s1;
  283.  
  284.   for (s1 = s0 + strlen (s0) - 1;
  285.        s1 > s0 && *s1 != '/'; s1--);
  286.  
  287.   if (*s1 == '/')
  288.     return s1+1;
  289.  
  290.   return s1;
  291. }
  292.  
  293. jmp_buf sigusr1_frame;
  294.  
  295. static void
  296. caught_sigusr1 (int dummy) { longjmp (sigusr1_frame, !0); }
  297.  
  298.  
  299. static char
  300. *dispname (s0)
  301.   char *s0;
  302. {
  303.   register char *s1;
  304.  
  305.   for (s1 = s0 + strlen (s0) - 1;
  306.        s1 > s0 && *s1 != ':'; s1--);
  307.  
  308.   return s1;
  309. }
  310.  
  311.  
  312. /* No arguments */
  313. int
  314. main (argc, argv)
  315. int argc;
  316. char **argv;
  317. {
  318.   char *xserver_file, *xinitrc_file, *home_path, *display, *display_X_arg;
  319.   int xserver_pid, orgmask;
  320.   
  321.   
  322.   /* Not that it really matters, just to avoid being used as a direct
  323.      replacement for xinit. */
  324.   
  325.   if (argc != 1)
  326.     {
  327.       fprintf (stderr, "usage: %s\n", basename (*argv));
  328.       exit (1);
  329.     }
  330.   
  331.   
  332.   /* Resolve xinitrc path. This is done before the server is
  333.      started. */
  334.   
  335.   if (!(home_path = getenv ("HOME")))
  336.     home_path = "/etc";
  337.   
  338.   if (!(xinitrc_file = getenv ("XINITRC")))
  339.     {
  340.       xinitrc_file = malloc (strlen (home_path) + 1 + strlen (XINITRC) + 1);
  341.       sprintf (xinitrc_file, "%s/%s", home_path, XINITRC);
  342.     }
  343.   else
  344.     xinitrc_file = strdup (xinitrc_file);
  345.  
  346.  
  347.   /* Resolve display */
  348.   if (!(display = getenv ("DISPLAY")))
  349.     display = display_X_arg = ":0.0";
  350.   else
  351.     display_X_arg = dispname (display);
  352.  
  353.  
  354.   /* Tell server to notify us when up and running */
  355.   signal (SIGUSR1, SIG_IGN);
  356.   orgmask = sigblock (sigmask (SIGUSR1));
  357.  
  358.   /* Start server */
  359.   if (!(xserver_pid = vfork ()))
  360.     {
  361.       xserver_file = DEFAULT_XPATH;
  362.       
  363.       execl (xserver_file, xserver_file, display_X_arg, NULL);
  364.  
  365.       fprintf (stderr, "%s: can't exec %s (errno = %d) -- start-up aborted\n",
  366.                basename (*argv), xserver_file, errno);
  367.       exit (1);
  368.     }
  369.  
  370.   if (xserver_pid < 0)
  371.     {
  372.       fprintf (stderr, "%s: can't fork (errno = %d) -- start-up aborted\n",
  373.                basename (*argv), errno);
  374.       
  375.       exit (1);
  376.     }
  377.   
  378.   /* Await signal from server */
  379. #if 0
  380.   /* Why the #@$*! doesn't this work?! */
  381.   sigsetmask (orgmask);
  382.   alarm (20);
  383.   sigpause (sigmask (SIGUSR1) | sigmask (SIGALRM));
  384. #else
  385.   sleep (5);
  386. #endif
  387.  
  388.   /* Open display */
  389.   if (!(top_display = XOpenDisplay (display)))
  390.     {
  391.       fprintf (stderr, "%s: unable to open display '%s' -- start-up aborted\n",
  392.                basename (*argv), display);
  393.       exit (1);
  394.     }
  395.   
  396.   /* Execute xinitrc file */
  397.   if (system (xinitrc_file) < 0)
  398.     system (DEFAULT_XCOMMAND);
  399.       
  400.   /* Close display */
  401.   XCloseDisplay (top_display);
  402.  
  403.   /* Terminate server */
  404.   kill (xserver_pid, SIGTERM);
  405.  
  406.   /* Finished */
  407.   free (xinitrc_file);
  408. }
  409.  
  410. 7. C shell background process termination logs you out
  411.    In C shell, unless "ignoreeof" is set, termination of a background
  412. process will log you out.  With "ignoreeof" set, just the message
  413. "Use logout to exit" will be printed.
  414.  
  415. 8. A security hole in login
  416.    David Wexelblat <dwex@mtgzfs3.att.com> reports: "There is a HUGE security
  417. hole in /bin/login in all USL derived SVR4s before 4.0.4.  Refer to CERT
  418. advisory CA-91:08, dated 5/23/91.  This is known to be present in AT&T SVR4
  419. 2.1, and Microport SVR4 3.1.  ESIX claims to have fixed it, Microport reports
  420. that it is fixed in 4.1.  I won't give any more details unless necessary.
  421. Suffice to say that this bug allows any non-privileged user on an SVR4 system
  422. to get read-write access to any file on the system."
  423.  
  424. 9. COFF problems with long filenames
  425.    A source at Dell urges: "Our SVR4v2 did some stuff that USL didn't get
  426. around to until SVR4v4.  Try Dell UNIX 2.1 with a COFF program on a large UFS
  427. filesystem in a directory with long names.  Runs on Dell UNIX.  Breaks on
  428. others."  I don't have more definite info yet.
  429.  
  430. 10. Flakeouts in the Wangtek device driver
  431.    Dell reports that USL's Wangtek device driver is seriously flaky.  "How'd
  432. you like a multi volume backup where the second and subsequent volumes don't
  433. follow on from the previous volumes?"  UHC confirms this and is actively
  434. working on the problem.
  435.    An anonymous SCOer says "The QIC02 tape controller `standard' is seriously
  436. flaky.  Our driver's in pretty good shape but nobody will ever have a truly
  437. solid driver that supports every QIC02 controller you can find."
  438.    Gordon Ross <gwr@mc.com> reports: "Actually, the SCSI tape target driver
  439. `st01' has a similar problem at version 4.0.3 which I corrected while I worked
  440. on the SVR4 code.  The correction was provided to the support group at USL.
  441. The actual problem was that the SCSI tape would return a `check status'
  442. completion code which was just trying to inform the driver of the arrival
  443. of the `logical end of media' indication but the driver was treating it
  444. as an error.  The tape drive had in fact written the data, but the driver
  445. incorrectly assumed that the "check status" return meant that it failed.
  446. The result of this is that when you write into the end of the tape, you
  447. can read back one more "chunk" than yu wrote.  Of course, cpio does not
  448. like this at all when doing multi-volume backups..."
  449.  
  450. 11. A kernel declaration bug
  451.     A botch in USL's /etc/conf/pack.d/kernel/space.c (which is present in
  452. Consensys 1.3, Dell 2.1, Esix 4.0.3A, Microport 4.0.3 and 4.0.4 and may also be
  453. present in other SVr4s) can step on the linesw[] table.  The problem is that
  454. the domain name array initialization is wrong and too short; thus, when it's
  455. set, data past the end of the array can be stomped.  To fix this, find the
  456. following near line 247:
  457.  
  458.     char srpc_domain[] = SRPC_DOMAIN;
  459.  
  460. and change it to
  461.  
  462.     char srpc_domain[SYS_NMLN] = SRPC_DOMAIN;
  463.  
  464. then rebuild the kernel.
  465.    Microport officially knows about this bug and plans to fix it in a
  466. near-future update release.  It has been fixed in Dell 2.2.
  467.  
  468. 12. Reading tar archives with cpio foos up on multiply-linked files
  469.     Paul De Bra <debra@info.win.tue.nl> reports the following:
  470.     In theory, cpio(1) is supposed to be able to read tar(1) archives.  In
  471. practice...don't try it.  Multiply-linked files will be extracted from the
  472. archive, whether or not they match the current pattern and whether or not
  473. you have selected 'u'.  This happens even if you use the `t' option, so
  474. it's not even save to list the archive files!  
  475.  
  476. 13. Process accounting is broken
  477.     In 4.0.3, process accounting doesn't work.  From examining the accounting
  478. scripts, it appears that /usr/lib/acct/accton is supposed to set a return code
  479. depending on whether accounting was switched on already or not.  However, it
  480. always returns the same result - accounting switched off.  This means that the
  481. /usr/lib/acct/ckpacct script, which is run every hour to keep the proccess
  482. accounting log in check, instead turns off accounting the first time it is run
  483. after booting.  The same happens with the nightly /usr/lib/acct/monacct
  484. program.
  485.    I don't yet know whether this bug is present in 4.0.4.  It is definitely
  486. un-fixed in Dell 2.1 and Consensys 1.3.  In Dell 2.2 the return bug is fixed,
  487. but accounting isn't automatically enabled at boot time.
  488.  
  489. 14. tar(1) foos up in the presence of symbolic links
  490.     Tar can get the names of symbolic links wrong when creating an archive.
  491. This bug can be demonstrated by doing the following:
  492.  
  493.    mkdir t
  494.    cd t
  495.    touch a 1234567890
  496.    ln -s 1234567890 b
  497.    ln -s a c
  498.    tar vcf ../t.tar .
  499.  
  500.    The output generated by tar is:
  501.  
  502.    a ./ 0 tape blocks
  503.    a ./a 0 tape blocks
  504.    a ./1234567890 0 tape blocks
  505.    a ./b symbolic link to 1234567890
  506.    a ./c symbolic link to a234567890
  507.  
  508. (Note the above commands should be done in the order shown and in a new
  509. directory)  This bug is nasty.  Recommended solution: use GNU tar.
  510.    This is reported from Esix 4.0.3 and Consensys 1.3, but probably exists on
  511. other SVr4s as well.  It has been fixed in Dell 2.2.
  512.  
  513. 15. Symbolic links can interfere with shellscript execution
  514.    There is a problem running #! scripts when symbolic links are involved.
  515. Typing in the following from a command shell demonstrates the problem:
  516.  
  517.    mkdir a b
  518.    ln -s a c
  519.    cd a
  520.    cat > script <<!
  521.    #!/bin/sh
  522.    echo Hello
  523.    !
  524.    chmod 755 script
  525.    cd ../b
  526.    ln -s ../c/script .
  527.    ./script
  528.  
  529. The message generated from the last line is:
  530.  
  531.      a/script: a/script: cannot open
  532.  
  533.    This is reported from Esix 4.0.3, Consensys 1.3, and Dell 2.2, but
  534. probably exists on other SVr4s as well.
  535.  
  536. 16. Piping a csh builtin causes the shell to hang.
  537.    While running csh, this can be demonstrated by some of the following:
  538.  
  539.    echo Hello | cat
  540.    history | more
  541.  
  542. (A solution to this one is use tcsh-6.02.)
  543.    This is reported from Esix 4.0.3 and Consensys 1.3, but probably exists on
  544. other SVr4s as well.  It is reported fixed in Dell 2.2.
  545.  
  546. 17. tar(1) fails to restore adjacent symbolic links properly
  547.   Arthur Krewatt <...!rutgers!mcdhup!kilowatt!krewat> reports:
  548.   SVR4 tar has another strange bug. Seems if when restoring files, you
  549. restore one file that is a link, say "a ->/a/b/c/d/e" and there is another
  550. link just after it called "b ->/a/b/c" tar will restore it as "b ->/a/b/c/d/e"
  551. This just seems to be a lack of the NULL at the end of the string, like
  552. someone did a memmov or memcpy(dest,src,strlen(src)); where it should be
  553. strlen(src)+1 to include the NULL.
  554.  
  555. 18. COFF binaries linked with curses(3) and shared libc hang
  556.    ...eating the CPU.  Cause unknown.
  557.  
  558. 19. shl hangs, sxt devices bad
  559.    shl(1) does not work.  Try creating a layer and doing an 'ls'.  Your session
  560. hangs.  Bruce Momjian <root%candle.uucp@bts.com>, who reported this bug, says
  561. he believes it is the sxt devices which are broken.  It definitely exists in
  562. Consensys 1.3.
  563.  
  564. 20. num-lock prevents mouse from working properly
  565.    When using the Motif window manager, if your num lock is on, your mouse
  566. clicks are not recognized by the window manager.  The mouse still works in
  567. xterm(1).  This is allegedly fixed in Destiny (4.2).
  568.    Under Dell 2.2 if num lock is on there's no problem, but if scroll lock
  569. is on then mouse clicks aren't recognised.
  570.  
  571. 21. adjtime() doesn't work
  572.   Hugh Stearns <hoyt@isus.tnet.com> reports that in 4.0.3.6 adjtime() doesn't.
  573. Calling `date -a' works to adjust the time slowly.
  574.  
  575. 23. cron mail doesn't go through aliasing
  576.   Hugh Stearns <hoyt@isus.tnet.com> reports that in 4.0.3.6 cron mail to adm
  577. doesn't get redirected by the aliases file.
  578.  
  579. 24. fragility in xterm
  580.   Hugh Stearns <hoyt@isus.tnet.com> reports that in 4.0.3.6, doing ~! from
  581. a cu in xterm kills xterm.  This has been fixed in Dell 2.2.
  582.  
  583. 25. csh lossage due to bad optimization
  584.   If a csh user sources a non-existent file in their .cshrc (eg, source .alias,
  585. where .alias doesn't exist), then the system will hang for a couple of minutes.
  586. Eventually the user get an "Out of memory" error and the console logs "NOTICE:
  587. out of swap space - Insufficient memory to allocate 2 pages - system call
  588. failed".
  589.   This appears to be due to over-optimization of code surrounding a longjmp
  590. call.
  591.   (There are numerous other reports of memory leak bugs in csh).
  592.  
  593. 26. Bug in cp(1)
  594.    If ``copy'' encounters a directory before a file, it dumps core ...
  595.  
  596. --- cut ---
  597. cd /tmp
  598. mkdir copybug jnk
  599. cd jnk
  600. mkdir directory
  601. >file
  602. cp -r * /tmp/copbug
  603. --- cut ---
  604.  
  605. This was reported from Consensys 4.0.3 but is probably a generic SVr4 bug.
  606. It appears to have been fixed in ESIX SVR4.0.3A and Dell 2.2.
  607.  
  608. 27. tbl -me doesn't work
  609.    Wolfgang Denk reports that trying to use "tbl -me" for any input file causes
  610. tbl to quit.  The problem is that newer tbl versions don't accept [nt]roff
  611. contol lines (".rm @W") after .TS.
  612.  
  613. 28. who -r fragility leads to boot-time problems
  614.   It coredumps if the name of the timezone (TZ) is longer than three characters
  615. and the length is a multiple of four.  This can be a real problem for European
  616. sites...  and is potentially more hazardous than immediately apparent as _a
  617. lot_ of the initialization scripts (rc1.d, rc2.d) use ``who -r'' to see if the
  618. machine is in single- or multi-user mode.  And when ``who'' bombs out, the
  619. ``set'' command is iven an empty command-line and can't do much else than print
  620. the shell variables, $1-$9 remain empty ... meaning that more or less all the
  621. scripts fail in various ways and the system has an exceptionally hard time
  622. coming up.
  623.    Peter Wemm <peter@DIALix.oz.au> reports that this bug was present in Dell
  624. 2.0, fixed in Dell 2.1, but reappeared in Dell 2.2.  Dell says it's a generic
  625. USL bug.
  626.    There is an easy workaround; make sure /etc/inittab is an odd number of
  627. characters long.  The bug is causes by an off-by-one in a buffer malloc.
  628.  
  629. 29. at(1) breaks here-documents in shell scripts
  630.    at adds gratuitous empty lines to the job submitted by the user.
  631. This prevents shell here-documents from working.
  632.  
  633. 30. UHC mouse driver ignores the middle button
  634.    This may be a generic USL problem, but Dell (at least) has fixed it.  UHC
  635. says they have a patch for it, but I haven't seen the patch.
  636.  
  637. 31. mmap acces doesn't update file mod times
  638.    Peter Wemm <peter@DIALix.oz.au> reports that under SVr4, if one mmap()'s a
  639. file, and writes to it via the mapped memory, when the disk is updated, the
  640. modification time does not update.
  641.  
  642. 32. AT&T select(2) is incompatible with BSD select(2)
  643.  
  644. Paul Eggert <eggert@twinsun.com>, as quoted by James Buster <bitbug@lynx.com>
  645. reports: 
  646.  
  647. The select() system call waits for read, write, or exception activity
  648. on a set of file descriptors, and yields an integer telling you how
  649. much activity it found.
  650.  
  651. BSD's select(N,&R,&W,&E,&T) can yield up to 3*N, because BSD's select()
  652. counts the number of bits that it turns on in in the R, W, and E
  653. arguments, and R, W, and E each contain one bit per file descriptor.
  654. However, System V Release 4 v2.1's select(N,&R,&W,&E,&T) yields at most N,
  655. because SVR4's select() just counts the number of active file
  656. descriptors, regardless of how many bits it turns on.
  657.  
  658. For example, the following code checks file descriptor 0.  In BSD, this
  659. code can set n to 2 if file descriptor 0 is ready for both reading and
  660. writing.  However, in SVR4, this code sets n to at most 1, because only
  661. file descriptor 0 is active.
  662.  
  663.     int n;
  664.     fd_set r, w;
  665.     FD_ZERO(r);  FD_SET(0, &r);
  666.     FD_ZERO(w);  FD_SET(0, &w);
  667.     n = select(1, &r, &w, (fd_set*)0, (struct timeval*)0);
  668.  
  669. At least one widely used piece of software depends on the BSD
  670. behavior, namely X11R5 (see Xt/NextEvent.c).  In this application, the
  671. bug's symptoms are subtle and are rarely encountered, but they do
  672. exist.
  673.  
  674. Most of X11R5's calls to select() don't care about this difference,
  675. but the following files in the X11R5 distribution contain calls to
  676. select() that may be affected by this bug:
  677.  
  678.     contrib/lib/i18nXView2/lib/libxview/notify/ndetselect.c
  679.         contrib/lib/xview3/lib/libxview/notify/ndetselect.c
  680.         mit/fonts/server/os/waitfor.c
  681.         mit/lib/Xt/NextEvent.c
  682.         mit/server/os/WaitFor.c
  683.  
  684. (Note: this is a very old bug.  Paul Eggert tells me that William Kucharski reported this bug to AT&T in 1989 when he ported X11R3!)
  685.  
  686. 33. (4.2) The login program requires its PPID to be 1
  687.    Rick Richardson reports: "The "/bin/login" program has been changed to be
  688. hardwired to require its PPID to be "1".  In all other versions of UNIX, it is
  689. sufficient that there be an /etc/utmp entry.  This bug was reported to USL, and
  690. I did get a fixed "login" program from them, but the fix did not make it into
  691. the release.  I don't know how mere mortals get the fix at this point."
  692.  
  693. 34. (4.2) Bad MAXMINOR values can make the system unbootable
  694.     Rick Richardson reports: "If MAXMINOR is stune'ed to the maximum value,
  695. 0x3fff (18 bits), then the kernel will refuse to boot, cycling up to driver
  696. initialization and then doing a processor recent.  Interestingly, this bug was
  697. not in the beta release, but was in the final release."
  698.  
  699. 35. (4.2) Incompatible change in TZ interpretation
  700.    Rick Richardson reports: "While not really a bug, this is a surprise.  In
  701. 4.2, the TZ variable was given a new meaning.  Rather than the traditional
  702. CST6CDT type of value, it now looks like ":US/Central".  This causes 3.2 and
  703. 4.0 binaries which use the date/time routines to report GMT time.  I have no
  704. idea why another variable name was not choosen.  I've taken to aliasing the
  705. binaries, e.g. "TZ=CST6CDT svr4binary"."
  706.   Mike "Ford" Ditto <ford@omnicron.com> corrects this.  "This change
  707. was made in 4.0, not 4.2, and 4.0 binaries should have no problem with
  708. the new format.  Some 4.0 systems use the new format by default.  The
  709. old format should be avoided unless SVR3 binaries are in use, since
  710. the new features of the time conversion libraries are only available
  711. if the new format is used."
  712.   Christoph Badura points out that the time functions still read the old
  713. TZ format, so you can set TZ=CST6DT or whatever and only the new features
  714. will be disabled.
  715.  
  716. 36. Nulls in pixmaps can crash X
  717.    Rick Richardson reports: "Displaying XPM2 pixmaps which have NULLS in them
  718. will crash the X server.  Admittedly, this is not much of a bug, since these
  719. are ill-formed or corrupted pixmaps.  But the server should stay up, even in
  720. these conditions.  A little error checking needed."
  721.  
  722. 37. Potential security hole in SVr4s using sendmail
  723.    Christoph Badura writes: "/usr/ucblib/aliases contains an alias for
  724. decode that feeds straight into uudecode.  I don't know under what uid
  725. uudecode gets invoked, but if it's root anyone can overwrite any file
  726. on a SVR4 system running the stock sendmail.  [Under Dell UNIX] t
  727. appears that the files get created with a user-ID of "daemon".  Not
  728. nice but better than root."
  729.  
  730. 38. Reporting bug in df on non-root filesystems
  731.    Paul Debra <debra@win.tue.nl> discovered that if df(1) is run on a
  732. filesystem other than root with a n argument of `.', the file system
  733. name is always reported as '/'.  This does *not* happen if you give
  734. it $PWD as argument.
  735.    This bug is present in Dell 2.2.
  736.  
  737. 39. tar writes -v output to stdout, not stderr
  738.    This is an incompatible, undocumented change from earlier UNIXes and
  739. royally screws up invocations like /bin/tar cvf - foo | /bin/tar tf - that
  740. previously worked.
  741.    Observed in ESIX 4.0.3A and 4.0.4, Dell 2.2; probably generic.  It
  742. also existed in SCO ODT and Xenix before 2.0 and 3.2v4, but has been fixed in
  743. these most recent versions.
  744.  
  745. 40. SIGPIPE is delayed and not reliable
  746.    Wolfgang Denk reports a kernel bug in src/uts/i386/fs/fifofs/fifovnops.c
  747. that results in SIGPIPE not getting raised immediately by failed writes.
  748. You can reproduce this with the following program:
  749.  
  750.     1    #include <stdio.h>
  751.     2    #include <signal.h>
  752.     3
  753.     4    extern int errno;
  754.     5
  755.     6    int sp();
  756.     7
  757.     8    int eop = 0;
  758.     9
  759.    10    char *line = "This is garbage.\n";
  760.    11
  761.    12    main () {
  762.    13        int i;
  763.    14        int l = strlen (line);
  764.    15
  765.    16        signal (SIGPIPE, sp);
  766.    17        for (;;) {
  767.    18    /*
  768.    19            for (i=0; i<10000; ++i) ;
  769.    20    */
  770.    21            if (write(1, line, l) != l) {
  771.    22                fprintf (stderr, "write error, errno=%d, eop=%d\n",
  772.    23                    errno, eop);
  773.    24                fflush (stderr);
  774.    25                exit (errno);
  775.    26            }
  776.    27        }
  777.    28    }
  778.    29
  779.    30    int sp()
  780.    31    {
  781.    32        fprintf (stderr, "SIGPIPE\n");
  782.    33        fflush (stderr);
  783.    34        eop = 1;
  784.    35    }
  785.  
  786. To test this, pipe its reslt to ls.
  787.  
  788. He writes: "That is, you can't be sure that SIGPIPE will be raised when a pipe
  789. breaks. Adding a short delay (for instance by uncommenting the for loop around
  790. line 19) gives _always_ SIGPIPE -- but usually you don't want to have
  791. additional delays in your program :-("
  792.  
  793.    Bernard Fouche <bernard@cpio1.fr.mugnet.org> observes that this is
  794. not necessarily a bug.  He writes: "Compile your example with the
  795. following change :
  796.  
  797.         - do not include your delay loop.
  798.         - add a line between line 24 and 25. This line will be :
  799.                         sleep(60);
  800.           This change will make a.out stay alive for 1 minute before
  801.           exiting.
  802.         - recompile, run with 'a.out|ls'.
  803.         - do 'ps -le |grep a.out'.
  804.  
  805. What you'll see is that a.out is now running in the background and its
  806. father is init(1)! So the return value of write(2) (EIO) can now be
  807. understood.
  808.  
  809. The only thing that I can tell is that pipes, that are now based on
  810. streams in SVR4, have a more complex behavior than in SVR3.2 but I
  811. would not call problem #40 a 'bug'. It can be related to the shell
  812. that ran the command and/or the scheduler and/or the stream subsystem."
  813.  
  814. 41. /usr/lib/acct/fwtmp doesn't work
  815.    John F. Haugh reports that under Dell UNIX the /usr/lib/acct/fwtmp command
  816. does not work as described in the man page; the output contains no line
  817. feeds and appears to be garbage.  I have verified this.
  818.    This is probably a generic SVr4 bug.
  819.  
  820. 42. whatis database is full of garbage.
  821.    Raymond Nijssen <raymond@woensel.es.ele.tue.nl> reports: "Both under ESIX
  822. 4.0.3 and 4.0.4, whatis database contains an awful lot of garbage, such as
  823. nroff macros. In addition, quite a lot of man pages mentioned are missing, and
  824. several available man pages are not mentioned. Since makewhatis is broken (at
  825. least under 4.0.3A), this cannot be repaired easily.  ESIX blamed USL for
  826. this."
  827.  
  828. 43. mmap is seriously broken
  829.  
  830. (thanks to Peter Wemm  <peter@zeus.dialix.oz.au> for a detailed report.)
  831.  
  832. ALL SVR4.0s have/had a nasty kernel bug that causes seemingly random executable
  833. and shared library corruption, and also unleashes a SERIOUS security bug. The
  834. "Copy-on-Write" mechanism within the kernel has bugs.  It is sufficient to say
  835. that the security related bug allows any user with shell and compiler access to
  836. WRITE to any file that they can read.
  837.  
  838. SVR4.2 has been fixed for some time.  ICL apparently fixed it in their sparc
  839. reference port (and x86 port), which means that Solaris2.x do not have the
  840. bugs.
  841.  
  842. The most common symptom of shared library corruption is that programs
  843. simply core dump when you attempt to access a non existing file.
  844.  
  845. $ more /notexisting
  846. Segmentation Fault (core dumped).
  847.  
  848. To recover from this, restore /usr/lib/libc.so.1 from the distribution media.
  849.  
  850. The security bugs have no known workaround, other than crippling the mmap()
  851. function in the kernel.
  852.  
  853. Dell has produced a fix for their release 2.2 systems. The patch is
  854. available from dell1.dell.com:/support2.2/CoW.t
  855.  
  856. Although it has not been tested, it is very unlikeley that Dell's patch will
  857. work on any other SVR4/386, as it replaces two kernel modules, and Dell's
  858. kernel has autoconfiguration extensions that are not present in other systems.
  859.  
  860. Dell 2.2 has got a STREAMS optimizer function enabled in the system that joins
  861. together small adjacent streams messages.  There were bugs in the early USL
  862. versions of this, but for 2.2, Dell enabled it after applying a fix from USL.
  863. It seems that in some rare circumstances, some machines are quite unstable with
  864. this enabled as default.  support2.2/CoW.t also disables the optimization to
  865. improve stability.  This brings Dell 2.2 into line with the other SVR4.0.4
  866. systems.
  867.  
  868. 44. a bug in xterm
  869.  
  870. Nickolay Saukh <nms@ussr.eu.net> reports ""
  871.  
  872. 45. DrawText16() bug in XWIN
  873.    Nickolay Saukh <nms@ussr.eu.net> reports "xterm strips off the eight bit of
  874. first character in line. This bug was present in x11r5 but fixed by some
  875. patch. I have no exact info under my thumb."
  876.    (Can anyone else confirm this bug?)
  877.  
  878. 46. output redirection with exec fails in sh
  879.    Andreas Luik <luik@isa.de> reports: "In Bourne shell scripts, the output of
  880. all following commands may be redirected using the "exec" builtin with an
  881. output redirection, e.g.
  882.     
  883.             exec > LOG
  884.             
  885. If such a construct is used in a for loop with a variable filename for the
  886. redirection, e.g. exec > $f, only the first output redirection is executed in
  887. the SVR4 /bin/sh.  It works correctly in /bin/ksh as well as in the HPUX, SunOS
  888. 4.1 and AIX Bourne shells."
  889.  
  890. 47. rm fails to reject . or .. arguments
  891.    Andreas Luik <luik@isa.de> reports: "rm does not check for `.' and `..'
  892. arguments.  The rm program should check for the arguments `.' and `..' (at
  893. least if called with the -r option) and ignore this arguments with the message
  894. "rm: cannot remove `.' or `..'". All implementation I'm aware of perform this
  895. check. As far as I know, this check is also in the SVR4 sources but implemented
  896. incorrect. This bug should be fixed for security reasons."
  897.  
  898. III. Serial-port and tty administration problems
  899.    Nickolay Saukh <nms@ussr.eu.net> reports "XWIN bug for DrawText16(). If one
  900. tries to output text line with more then one font, then text segment with
  901. second font (and subsequent segments) displayed shifted to left. This bug also
  902. fixed by some patch to x11r5."
  903.    (Can anyone else confirm this bug?)
  904.  
  905. 1. Dropout problems with tty devices
  906.    The most serious problem anyone has reported is that the USL asy driver is
  907. flaky and occasionally drops characters at above 4800 baud.
  908.    Microport, Dell, Esix, and UHC say that they believe they've fixed this.
  909. However, Dell, at least, was mistaken when they first made this claim; a more
  910. detailed description of the problem is given below.  I have been assured that
  911. this is on the fix list for the next Dell release.
  912.    Bela Lubkin at SCO comments "386 interrupt latency vs. unbuffered UARTs.
  913. This is a tough problem.  Nobody's driver should drop characters with a
  914. turned-on 16550.  It's not so easy with a 16450.  Anyone with 16450s or lower
  915. should be able to solve their problems by dropping in a 16550."
  916.  
  917. 2. Quick port setup option in sysadm is broken
  918.    In 4.0.3 sysadm, the quick port setup option, which is used to add and
  919. delete terminal ports, is seriously broken.  The script modifies /etc/conf/*
  920. files, and has incorrect minor numbers, sets the 5th field of sdevice.d to Y
  921. when it should be N, and is missing columns for node.d.  See
  922. /usr/sadm/sysadm/bin/q-add.  This bug is present in USL 4.2 as well
  923. (certainly in Consensys V.4.2).
  924.  
  925. 3. ttymon drops DTR when it shouldn't
  926.   Hugh Stearns <hoyt@isus.tnet.com> reports that in 4.0.3.6 the ttymon(1)
  927. utility for HDB uucp drops DTR every few weeks.  The workaround is to disable
  928. and re-enable it.
  929.    The SVr4.2 ttymon is even more broken; it *never* raises DTR after the
  930. first outgoing call.  Jeremy Chatfield at IF has confirmed that this is a
  931. real bug in the USL sources and is on his urgent-fix list.
  932.  
  933.    In the May 10, 1993 issue of Open Systems Today, page 70, Jason Levitt
  934. describes some of his ttymon problems.  He has a file posted on ftp.uu.net
  935. under /published/open-systems-today/other/svr42uucp.tar; This tar file
  936. contians a fixed ttymon program along with a text file describing setting
  937. up ttymon and uucp so that it works pretty well.
  938.  
  939. 4. ttymon doesn't drop DTR when it should
  940.    Stephen Hebditch <steveh@orbital.demon.co.uk> reports from a Dell
  941. 2.2 system:
  942.    "When a user logs out, ttymon does not appear to lower the DTR line for
  943. a sufficiently long enough time to always cause the modem to drop
  944. carrier. The WorldBlazer modem here is set to its default of 50ms DTR
  945. detection time - the minimum time allowable - but around 2 times out of
  946. 10, when a user logs out it will not drop carrier although the DTR
  947. light on its front panel can be seen to blink momentarily.
  948.    Disabling service for a particular device (e.g. using 'pmadm -d -p
  949. ttymon3 -s 00') will only work if ttymon hasn't spawned a child process
  950. for that port.
  951.    According to the manual "ttymon should exit if no one types anything in
  952. <timeout> seconds after the prompt is sent". Occasionally when hanging
  953. up an outgoing connection, spurious characters can trigger ttymon into
  954. thinking that there is a new user wanting to log in. Because it has
  955. seen these characters, ttymon will then not time-out, locking up that
  956. port until the controlling ttymon child process is killed."
  957.    See the fix note attached to III.3.
  958.  
  959. 5. (4.2) Terminating cu to a direct line locks up the port
  960.     The problem is the C2 security mechanisms.  Terminating cu with ~.
  961. doesn't tear them down correctly.  Subsequently, another cu(1) will be
  962. able to get at the port, but utilities which try to get at it directly (i.e.,
  963. cat or stty) won't be.
  964.     Rick Richardson <rick@digibd.com> adds: "The "cu" problem where ports
  965. can't be used by stty, seyon, or other programs once "cu" has had its way
  966. with them:  This problem apparently affects any program (cu, uucp) that uses
  967. the DIAL(3) routines.  Those routines have been modified to use the "cs"
  968. connection server daemon to open the port and/or dial a phone number on behalf
  969. of the client (though you'd hardly realize this from reading the manual page).
  970. The "cs" daemon does *something*, where *something* is not known yet, which
  971. causes all subsequent termio type ioctl's to fail.  This bug has been reported
  972. to USL and Univel, but no fix has been forthcoming."
  973.     He continues: "I had our streams device driver guy put in a version of one
  974. of our serial port drivers with debugging turned on, and he said that it looked
  975. like the driver "close" routine was never getting called - possibly because the
  976. device close call only happens on the last close of a device, and the
  977. connection server has still got the port open.  This theory would seem to
  978. indicate that "cu" and "uucp" are fine, but that the connection server is
  979. broken.  We don't really know, though -- its just a theory.
  980.    See the fix note attached to III.3.
  981.  
  982. 6. Hardware flow control bug breaks streaming data transfers
  983.    Stephen Hebditch <steveh@orbital.demon.co.uk> reports from a Dell
  984. 2.2 system:
  985.    "There is a definite problem with hardware flow control. If
  986. characters are being continually sent to the modem with no break, then
  987. after around 40K or so the asy driver will ignore the fact that the
  988. modem has lowered the CTS line and will keep on sending.  Up to that
  989. point it will correctly stall when the CTS line is lowered. If there
  990. is a break in sending, then flow control will work correctly once
  991. more.  This means that streaming protocols such as Z-Modem will break
  992. but simpler protocols like UUCP g which don't fill up the modem buffer
  993. will work correctly."
  994.    Your editor has seen this one himself while attempting to use rz
  995. for uploads to his friendly Internet site, as was his wont under SVr3.
  996. I now get around this by using ymodem protocol for uploads.
  997.    This is probably a generic bug in 4.0.4 serial handling.
  998.  
  999. 7. Bad interaction between ttymon and networking
  1000.    Stephen Hebditch <steveh@orbital.demon.co.uk> reports from a Dell
  1001. 2.2 system:
  1002.   "A problem with ttymon, in.telnetd and in.rlogind. When a user logs out,
  1003. wrong entries are written to utmp and wtmp. This results in utmp and
  1004. wtmp containing a new record for that user for a session starting at
  1005. the time that they logged out. This results in some programs (finger
  1006. for example) showing that users are logged in when they are not and
  1007. means that login accounting is not possible."
  1008.    See the fix note attached to III.3.
  1009.  
  1010. IV. Networking and File Sharing Bugs 
  1011.  
  1012. 1. NFS locking is unusably slow
  1013.    Randy Terbush <randy@dsndata.dsndata.com> has posted code which
  1014. demonstrates a serious bug in the SVr4 NFS locking daemon.
  1015.    In his own words: "The symptoms are ~30% cpu usage by 'lockd' and
  1016. severe slowing of the machines on the network.  This program
  1017. demonstates that it takes ~20 seconds to obtain locks from an ailing
  1018. 'lockd'.  We have verified that this bug does not exist in HPUX 8.0x."
  1019.    Randy's code is too large to be included here.  He is, quite
  1020. rightly, exercised at USL's exceedingly slow response to this problem.
  1021. The comment in his makefile reads, in part:
  1022.  
  1023. # USL has admitted to the existance of this bug in version 4.0, 4.1,
  1024. # and 4.2 of their distributed and yet to be released sources.  This is
  1025. # a network crippling problem that they have refused to fix until
  1026. # release 4.3, which will be OVER 1 YEAR from today. (29 Oct 1992)
  1027. # If your version of 'lockd' exhibits this same problem, I would
  1028. # strongly urge you to contact your vendor and ask them to put some
  1029. # pressure on USL to fix this problem.  SVR4 is virtually useless in a
  1030. # network of shared resources while this problem exists.
  1031.  
  1032. 2. UFS file system problems
  1033.    In stock USL 4.0.3, you can't use a UFS file system as the root; the system
  1034. hangs if you try.  Consensys, Dell, Esix, Microport, MST, UHC, and ESIX all
  1035. appear to have fixed this.
  1036.    David Aitken, the UNIX product manager at UHC, writes "The ufs as root file
  1037. system [problem] was not really a bug, just a little oversight on USL's part -
  1038. we have fixed it completely by adding one line to the /stand/boot script:
  1039. rootfstype=ufs!"  He adds that they've been using ufs on their lab machines for
  1040. over 10 months with no trouble, and the latest UHC release defaults to ufs if
  1041. you have more than 120MB of disk.
  1042.  
  1043. 3. Byte-order problem with NFS when accessing Sun disks
  1044.    Christoph Badura <bad@generics.ka.sub.org> notes that the stock USL resolver
  1045. library suffers from serious confusion about the byte order in the
  1046. socketaddr_in structure.  This bug is acknowledged by USL for the 4.0.4
  1047. release.  A symptom of this bug is that Sun disks will not mount correctly over
  1048. NFS. As a workaround, try removing the references to /usr/lib/resolv.so from
  1049. /etc/netconfig and rebooting your system.  Unfortunately, this will mean
  1050. you can't use nameservers.
  1051.    Alan Batie <batie@agora.rain.com> writes: "Actually, you don't have to
  1052. remove resolv.so, just put tcpip.so first and have a hosts file with the names
  1053. of hosts you want to do NFS mounts from.  This way you can use nameservers for
  1054. most things."
  1055.  
  1056. 4. Under weird circumstances, lseek on UFS may cause corruption
  1057.   Christoph Badura <bad@generics.ka.sub.org> reports that a UFS lseek() to an
  1058. offset which is a multiple of 4096 but not a multiple of 8192, followed by a
  1059. write(), may corrupt the file being written.  The bug shows up only, if the
  1060. file has no pages in the page pool associated with it at the seek offset and at
  1061. 4k before the seek offset.  He has sent USL kernel fix for this, which was
  1062. included in 4.0.4.
  1063.  
  1064. 5. FTP problems
  1065.   The in.ftpd on SVR4.0.3 does not support all the commands listed in RFC 959.
  1066. When recent SCO UNIX/ODT versions ftp to SVR4.0.3, the SVR4 side will refuse,
  1067. drop the connection, and core dump after you authenticate.  This is because the
  1068. SCO end sends the 'SYST' command ala RFC 959, and the SVR4.0.3 end doesn't
  1069. recognise it.  Some ports have fixed this.
  1070.   Christoph Badura adds: "The bug is do to a longjmp(3) on a sigjmpbuf obtained
  1071. by sigsetjmp(3). ARGH. Testing led to a bug in the original BSD sources, which
  1072. is still present in the NET/2 ftpd.  "
  1073.  
  1074. 6. A bug in the WD80x3 support
  1075.    MST reports a serious bug in the SVr4 kernel support for this card.  Here's
  1076. how to reproduce it:
  1077.  
  1078.     server: init 3 and share (export) /usr for example.
  1079.  
  1080.     client: mount -F nfs server:/usr /mnt
  1081.         cd /mnt
  1082.         find . -print | cpio -ocBuv > /dev/null
  1083.  
  1084.     what happens:
  1085.         server and client will "hang" together.
  1086.  
  1087.     "cue":
  1088.         hit keys on server and/or client, hang will go away
  1089.         for 10-20 seconds temporarily.  Yank BNC connectors
  1090.         do the same trick.
  1091.  
  1092.    They say they've heard from customers that this happens on Dell, UHC as well
  1093. as USL 4.0.4.  PCNFS/BWNFS network xcopy suffers this as well.  Client can be a
  1094. Sun Sparc for that matter.
  1095.  
  1096. 7. Security hole near fingerd
  1097.    Jerry Whelan <guru@stasi.bradley.edu> reports:
  1098.     We encountered a cute security hole in AT&T SVR4 2.1 (which I believe
  1099. translates to USL 4.0.2).  It apparently was fixed in AT&T SVR4 3.0.  The
  1100. hole related to the finger daemon.  If a user set his .plan to a symbolic
  1101. link pointing to a protected file (such as /etc/shadow, or somebody's
  1102. mail file) then fingering the user would cause the finger daemon to read
  1103. that file and display it.
  1104.     I don't know if the bug exists in any other vendor's versions of 4.0.2.
  1105.     We replaced our fingerd with gnu finger, only to find the same problem.
  1106. I sent the changes back to the gnu finger developer, but I don't think a
  1107. newer fixed version has been officially released yet.
  1108.    Steve Peltz <peltz@cerl.uiuc.edu> writes: "The fix to the fingerd problem
  1109. (pointing a .plan file to a protected file and thus getting read access to it)
  1110. can be fixed by changing inetd.conf to not give root privileges to the fingerd
  1111. process. It seems like overkill to have fingerd set to the user id of the
  1112. person you're fingering to see if you should have access to the file."
  1113.  
  1114. 8. Fatal bug in priority-band message handling.
  1115.    Douglas C. Schmidt" <schmidt@liege.ICS.UCI.EDU> reports:
  1116.    There is a bug with handling priority-band messages that causes several
  1117. System V Release 4 versions (particularly Solaris 2.1) to crash.  The following
  1118. code replicates the problem.  Sun has been notified and claims they will fix
  1119. this problem in the next release (2.2?).
  1120.  
  1121. /* This program causes System V Release 4 to crash! */
  1122. #include <sys/types.h>
  1123. #include <sys/fcntl.h>
  1124. #include <stdio.h>
  1125. #include <stropts.h>
  1126.  
  1127. #define FIFO "/tmp/foo"
  1128. #define BIGFILE "/usr/dict/words"
  1129.  
  1130. static int
  1131. do_child (int fifo_fd)
  1132. {
  1133.   struct strbuf msg;
  1134.   char   buf[BUFSIZ];
  1135.   
  1136.   msg.maxlen = sizeof buf;
  1137.   msg.buf    = buf;
  1138.  
  1139.   do
  1140.     {
  1141.       int flags = 0;
  1142.  
  1143.       if (getmsg (fifo_fd, 0, &msg, &flags) != -1)
  1144.     (void) printf ("(%2d) (%2d): %s", 
  1145.                msg.len - sizeof (int), *(int *) msg.buf, msg.buf + sizeof (int));
  1146.       else
  1147.     return -1;
  1148.     }
  1149.   while (msg.len != 0);
  1150.  
  1151.   return 0;
  1152. }
  1153.  
  1154. static int
  1155. do_parent (int fifo_fd)
  1156. {
  1157.   FILE *fp;
  1158.   char buf[BUFSIZ];
  1159.  
  1160.   (void) srand ((unsigned) time (0));
  1161.  
  1162.   if ((fp = fopen (BIGFILE, "r")) == 0)
  1163.     return -1;
  1164.  
  1165.   while (fgets (buf + sizeof (int), sizeof buf, fp) != 0)
  1166.     {
  1167.       struct strbuf msg;
  1168.       int           band = rand () % 11;
  1169.  
  1170.       msg.buf = buf;
  1171.       msg.len = strlen (buf + sizeof (int)) + 1 + sizeof (int);
  1172.       *(int *) buf = band;
  1173.  
  1174.       if (putpmsg (fifo_fd, 0, &msg, band, MSG_BAND) == -1)
  1175.     return -1;
  1176.     }
  1177.   return 0;
  1178. }
  1179.  
  1180. int
  1181. main (void)
  1182. {
  1183.   int fd;
  1184.  
  1185. #if defined (TEST_FIFO)  
  1186.   (void) unlink (FIFO);
  1187.   
  1188.   if (mkfifo (FIFO, 0666) == -1)
  1189.     perror ("mkfifo"), exit (1);
  1190. #else
  1191.   int pipe_fds[2];
  1192.  
  1193.   if (pipe (pipe_fds) == -1)
  1194.     perror ("pipe"), exit (1);
  1195. #endif
  1196.  
  1197.   switch (fork ())
  1198.     {
  1199.     case -1:
  1200.       perror ("fork"), exit (1);
  1201.     /* NOTREACHED */
  1202.     case 0:
  1203. #if defined (TEST_FIFO)
  1204.       if ((fd = open (FIFO, O_RDONLY)) == -1)
  1205.     return -1;
  1206. #else
  1207.       fd = pipe_fds[0];
  1208.       close (pipe_fds[1]);
  1209. #endif 
  1210.       if (do_child (fd) == -1)
  1211.     perror ("do_child"), exit (1);
  1212.  
  1213.       break;
  1214.     default:
  1215. #if defined (TEST_FIFO)
  1216.       if ((fd = open (FIFO, O_WRONLY)) == -1)
  1217.     return -1;
  1218. #else
  1219.       fd = pipe_fds[1];
  1220.       close (pipe_fds[0]);
  1221. #endif
  1222.       if (do_parent (fd) == -1)
  1223.     perror("do_parent"), exit (1);
  1224.       break;
  1225.     }
  1226.   return 0;    
  1227. }
  1228.  
  1229. 9. SVr4.0.4 TCP/IP routing is broken
  1230.    Raymond Nijssen <raymond@woensel.es.ele.tue.nl> reports:
  1231.    "I found a problem with ESIX 4.0.4 TCP/IP routing. I'm not sure if it's also
  1232. present in other SVR4 flavors.  The problem is that once a system has received
  1233. an ICMP route redirect message, it is supposed to store the new route in its
  1234. routing tables.  This does not work properly, which is revealed by ping(1)ing
  1235. to a host though a gateway in a more complex network configuration.  For almost
  1236. every packet is sent to another gateway than the one which corresponds with the
  1237. network of the destination.  This in turn leads to an enormous amount of ICMP
  1238. messages, which leads to bad network thoughput.  We also had some mysterious
  1239. crashes until we decided to change the network configuration to circumvent this
  1240. problem."
  1241.    (This seems very likely to be a generic SVr4 problem).
  1242.  
  1243. 10. df(1) on NFS volumes returns bad data
  1244.    Raymond Nijssen reports from Esix 4.0.3A and 4.0.4: " Diskspace figures of
  1245. NFS mounted filesystems reported by both /bin/df and /usr/ucb/df are 4 times
  1246. too big."
  1247.  
  1248. 11. rsh hogs the processor
  1249.    Raymond Nijssen <raymond@woensel.es.ele.tue.nl> reports from Esix 4.0.3A and
  1250. 4.0.4: "The rsh command hogs the CPU. On an empty system, `rsh foo -n bar'
  1251. takes 1 second kernel-mode CPU per second elapsed."
  1252.  
  1253. 12. MTU for remote networks ignored
  1254.    Nathan D. Lane <nathan@seldon.foundation.tricon.com> reports: "Esix 4.0.4
  1255. ignores the MTU for remote networks.  I have PPP setup on my RS/6000 and the
  1256. Esix box connects via ethernet to the RS/6000.  Packets are always sent out
  1257. "full size" by the Esix machine, no matter where their destination.  It is my
  1258. understanding that, when routing to a remote network where the MTU is a)
  1259. unknown or b) set to something lower than 1536, the originating machine should
  1260. make the packets smaller.  Instead, when the Esix box blasts out its packets
  1261. across the PPP link, it sends them full size, making the other end do *a lot*
  1262. of packet reassembly.""
  1263.    This has not been confirmed on other ports, but seems likely to be
  1264. a generic SVR4 problem.
  1265.  
  1266. 13. Bug in remote printing.
  1267.    A couple of USENETters have reported that the remote-printing support for
  1268. lpr (the System V print spooler) is broken in SVr4.0.  Printing is done
  1269. correctly, but the job is not then removed from the print queue on either
  1270. system.
  1271.  
  1272. V. SCSI Support Problems
  1273.  
  1274. 1. sar is confused by SCSI
  1275.    Sar -d doesn't work on SCSI drives.  Dell fixed this in 2.1 and it's
  1276. reported to work OK in Esix 4.0.3A; no report of any other SVr4 having fixed
  1277. this yet.  SCO fixed it in 3.2.4.  Appears to be fixed in USL 4.2.
  1278.  
  1279. 2. A configuration problem
  1280.    Stock USL 4.0 requires you to jumper your SCSI devices to fixed IDs
  1281. during installation (it can be changed to any other ID after).  Specifically,
  1282. the tape must be ID 6.
  1283.    Dell says they've fixed this.  The requirement is definitely still present
  1284. in Esix and Consensys 1.3.  UHC thinks they've fixed this, but their 4.0.3.6
  1285. release still seems to demand ID 1 to install.
  1286.    I've seen an email report that USL 4.2 still has this problem.  But after
  1287. publishing this, I got a request for more info from Mike Drangula
  1288. <miked@usl.com> at USL.  He wrote:
  1289.  
  1290. >                                                                 As far as
  1291. > I know ( and I wrote the SCSI configuration tools for 4.2 ), there is only
  1292. > one case where a device is required to be at a particular SCSI ID, unless
  1293. > you count the requirement that the HBA be at ID 7.
  1294. > The only requirement for a given SCSI id is that, on a SCSI-based MCA
  1295. > machine that uses IBM's SCSI Host Adapters, the boot disk must be at ID 6
  1296. > if there is more than one disk installed on the HBA.
  1297. > The old requirement that the tape be set to SCSI ID 6 is no longer in effect.
  1298. > If your HBA will support booting from it, there is not even a requirement 
  1299. > that the boot SCSI disk be at SCSI ID 0.  The only requirement for disks is 
  1300. > that the boot disk must have the lowest SCSI ID of any DISKS on the system
  1301. > ( except in the already noted case of MCA SCSI )
  1302.  
  1303. Give Mike a hand for actually reading this bug list.
  1304.  
  1305. 3. Synchronous SCSI hang problem
  1306.    David Wexelblat <dwex@mtgzfs3.att.com> reports: "Stock SVR4.0.3 will hang
  1307. the SCSI bus with a 1542 in synchronous mode.  Dell fixed this, and this has
  1308. been given to Microport [ed note: Microport 4.0.4 and Consensys 4.0.3 have
  1309. fixed the problem; MST UNIX and Esix 4.0.3 still have this problem; I have not
  1310. yet been able to determine if ESIX 4.0.4 does].  In the file /sbin/bcheckrc,
  1311. change the line:
  1312.  
  1313.     echo MARK > /dev/rswap
  1314.  
  1315. to
  1316.         
  1317.     echo MARK | dd of=/dev/rswap bs=512 conv=sync > /dev/null 2>&1
  1318.  
  1319. The magic is apparently the conv=sync, which forces a 512 byte block
  1320. to be written.  The original echo writes 4 bytes, which apparently causes
  1321. synchronous SCSI to go out to lunch.
  1322.  
  1323. Now, you ask, how can I fix this, since the system won't boot?  There are
  1324. a couple of methods.  First, if possible, disable synchronous negotiation
  1325. (1542 jumper J5-1 removed, plus whatever you may need to do to your drive).
  1326. Then boot up, edit /sbin/bcheckrc, then shutdown, restrap for synchronous,
  1327. then reboot.  Everything should be OK.
  1328.  
  1329. That's the easy way.  Unfortunately, some hard drives will only work
  1330. in synchronous mode.  Well, you can still recover from this phenomenon.
  1331. Here's how:
  1332.  
  1333.         1) Install on your hard drive
  1334.         2) Boot from the first boot floppy.  When it tells you to, insert
  1335.            the second boot floppy.  At the first prompt, hit <DEL> to
  1336.            break out to a shell.
  1337.         3) Mount your hard drive under /mnt with the following command
  1338.            (replace FS-TYPE with s5, s52, or ufs, whichever you used for
  1339.            for your root partition):
  1340.  
  1341.                 /etc/fs/FS-TYPE/mount /dev/dsk/c0t0d0s1 /mnt
  1342.  
  1343.         4) Now edit /mnt/sbin/bcheckrc:
  1344.  
  1345.                 ed /mnt/sbin/bcheckrc
  1346.  
  1347.            You may want the 'ed' man page handy (I barely remember how to
  1348.            to use 'ed' :->).  For simplicity, you can delete/comment out
  1349.            the offending line, then replace it with the correct line later.
  1350.         5) Unmount the hard drive:
  1351.  
  1352.                 umount /mnt
  1353.  
  1354.         6) Reboot from the hard drive.  Everything should come up OK. and
  1355.            you can finish editing /sbin/bcheckrc, if necessary.
  1356.  
  1357. Note that you perform these actions at your own risk.  The first version was
  1358. performed by me on Microport SVR4, and the second was performed by someone
  1359. else (on my suggestion) on ESIX SVR4."
  1360.    This problem appears to be fixed on Consensys 1.3 and Dell 2.1; also
  1361. (pace David's remark) in ESIX 4.0.4, which has
  1362.  
  1363.     echo MARK | /sbin/dd.arch conv=sync > /dev/rswap 2> /dev/null
  1364.  
  1365. 4. ps chokes on commands that do SCSI I/O
  1366.   Hugh Stearns <hoyt@isus.tnet.com> reports that in 4.0.3.6, ps
  1367. doesn't work when a SCSI command in progress. It stops printing at the
  1368. process executing the scsi command.
  1369.   This is still broken in Dell 2.2 and ESIX 4.0.3.
  1370.  
  1371. 5. Transfer speed problems with Adaptec 1542B on 486s
  1372.   If a system mount or install fails, try setting the DMA speed to 5MB/s,
  1373. rather than the default 5.7MB/s.  This is accomplished by removing the jumper
  1374. shorting the 12th pin pair of jumper block 5.
  1375.  
  1376. 6. df gives inaccurate values for large SCSI partitions
  1377.    Derek Terveer <derek.terveer@stpaul.gov> reports "I was on a Esix 4.0.4
  1378. system recently with a >1024 cylinder (i.e., ~1.05 GB disk) and the df command
  1379. was giving wildly inaccurate values.  I presume that this has something to do
  1380. with the size of the partitions, because it works just fine on a system with
  1381. smaller drives and partitions."
  1382.  
  1383. VI. Development Tools Problems
  1384.  
  1385. 1. General UCB library brokenness
  1386.    The BSD compatibility libraries were badly broken in USL code.  A Dell
  1387. source adds "That meant that almost all the apps derived from them were broken
  1388. too.  Most stuff like automount will die when you send a SIGHUP, instead of
  1389. rereading the map file.  You can get a system into very strange states when
  1390. that happens."
  1391.    John Sully <jms@mport> of Microport opines: "This is a bug in automount
  1392. itself rather than BSD compatibility, since the automount which comes with SVR4
  1393. is not compiled with the BSD libraries.  (isn't this comforting??  :-()."
  1394.  
  1395.    Peter Wemm <peter@DIALix.oz.au> reports "There is a very simple and reliable
  1396. sure to this sort of thing: Using your favourite hex editor, change all
  1397. instances of "signal" in the binary file to "sigset".  Most BSD code assumes
  1398. that signal() auto-rearms after handling a signal.  On SVR4, signal() does not,
  1399. but sigset() is argument compatible, and has BSD semantics."
  1400.  
  1401.    Esix and UHC's BSD libraries are USL stock.  I don't yet know
  1402. the status of other ports.  Microport has run into things they think may be
  1403. symptoms of this but have no fix yet.
  1404.  
  1405.    John Sully <jms@mport> of Microport counters with: "One common thread I find
  1406. on reading of these problems is that the BSD compatibility libraries are
  1407. *misused*. [...] The problem is that BSD and SYSV have similarly named .h files
  1408. which sometimes contain different definitions for objects with the same name.
  1409. This has been known to cause all sorts of problems because the SYSV headers are
  1410. picked up and then the calls are satisfied from the BSD library rather than the
  1411. shared object library.  I have found that if you use /usr/ucb/cc that the BSD
  1412. compatibility is much less broken than it would seem at first because it
  1413. ensures that the correct headers are picked up."
  1414.  
  1415.    However, note that there is at least one *real* bug known --- as of 4.0.4
  1416. the signal emulation cannot explicitly set a handler to SIG_DFL or SIG_IGN.
  1417.  
  1418.    Developers should be very careful that if they use -L/usr/lib/ucb -lucb 
  1419. the cc used is also the Berkeley cc.
  1420.  
  1421. 2. USL emulation of BSD signals doesn't work
  1422.    A different source reports that the the USL implementatation of BSD signals
  1423. is broken in both 4.0.3 and 4.0.4; in particular, the sigvec() family doesn't
  1424. work properly.  It is possible to make minor tweaks to source to make such apps
  1425. work properly with the native USL signals implementation.
  1426.  
  1427.    Here's more on the signals problem, thanks to Richard <rc@siesoft.co.uk>:
  1428. ------------------------------------------------------------------------------
  1429. The problem is to do with the signal() function that is within the BSD
  1430. compatability libc. 
  1431.  
  1432. To reproduce the problem do the following:
  1433.  
  1434. #include <stdio.h>
  1435. #include <sys/types.h>
  1436. #include <signal.h>
  1437. #include <sys/siginfo.h>
  1438.  
  1439. main()
  1440. {
  1441.     signal(SIGPIPE,SIG_IGN);
  1442.     pause();
  1443. }
  1444.  
  1445. and compile it with cc xx.c -o xx /usr/ucblib/libucb.a
  1446.  
  1447. (John Sully observes that this is definitely wrong; /usr/ucb/cc should have
  1448. been used rather than "cc ... -L/usr/ucblib -lucb" or the equivalent "cc ...
  1449. /usr/ucblib/libucb.a".)
  1450.  
  1451. If you run the program and then signal it with a SIGPIPE, the program
  1452. will die, even though you've told it to ignore SIGPIPE.
  1453.  
  1454. The fix is difficult unless you've got source because there's a missing 'else'
  1455. clause from the signal() code. This is the only signal fault I've found in
  1456. the BSD signal functions, details of the rumoured sigvec problem would be
  1457. useful?
  1458.  
  1459. If you're trying to compile an application you could change the application
  1460. code to do the following, this does work..
  1461.  
  1462. void
  1463. catch(s)
  1464. int    s;
  1465. {
  1466.     /* DO NOTHING */
  1467.     ;
  1468. }
  1469.  
  1470. main()
  1471. {
  1472.     signal(SIGPIPE,catch);
  1473.     pause();
  1474. }
  1475.  
  1476. SUMMARY
  1477. You can only change a signal handler to a function handler, any number of
  1478. times.  Any attempt to set the handler to SIG_DFL, or SIG_IGN will fail.
  1479.  
  1480. This bug has given some people working with X11R5 aggro, causing the X server
  1481. to die when you close a client. 
  1482.  
  1483.   Christoph Badura <bad@flatlin.ka.sub.org> confirms this bug
  1484. He has sent USL a source fix.  It appears already to have been fixed in Dell
  1485. 2.2.
  1486. ------------------------------------------------------------------------------
  1487.  
  1488. 3. Possible string library problems
  1489.    There are also persistent rumors of problems in the BSD-emulation string
  1490. libraries.  I have not been able to pin down specifics on this.
  1491.  
  1492. 4. USL's ndbm support is broken.
  1493.    Christoph Badura <bad@generics.ka.sub.org> reports "The ndbm functions in
  1494. the ucb library are broken [apparently due to a compiler of optimizer bug in cc
  1495. -- ed.].  Try makeing the whatis data base for /usr/share/man with Tom
  1496. Christiansen's perl rewrite of man. 
  1497.    The easiest way to fix this is to compile GNU's replacement ndbm.c with gcc
  1498. -fpcc-struct-return -traditional (gcc1.40 or 2.2 will do nicely) and install it
  1499. in your C library.  Source is available for FTP from prep.ai.mit.edu.
  1500.  
  1501. 5. An include file is missing
  1502.    Both 4.0.3 and 4.0.4 USL versions are missing the documented dial.h
  1503. file from their /usr/include directory.  Dell 2.[12] has it.
  1504.  
  1505. 6. sscanf(3) has a potential bug
  1506.    Anthony Shipman <als@bohra.cpg.oz.au> reports: " I found the following bug
  1507. in SCO Unix 3.2.* and I think it may be common to many AT&T derived Unixes.
  1508.  
  1509. sscanf() calls _doscan() to read from a pretend file.  The file
  1510. uses the string as a buffer and a fake file descriptor of 60 (=_NFILE).  
  1511. Since _NFILE (for SCO UNIX) is 60 it assumes that fd 60 can never be open.
  1512.  
  1513. Then when fscanf() hits the end of the string it calls _filbuf() to read
  1514. into the buffer (which is the string) from fd 60.  This should fail with
  1515. an errno=9 and then _filbuf() sets EOF and it all terminates.
  1516.  
  1517. However in SCO Unix you can reconfigure the kernel to increase the number
  1518. of files per process to a recommended maximum of 150.  If you do this then
  1519. your program might have fd 60 open one day.  Then sscanf() will read from this
  1520. file overwriting your string.  The byte count to the read() in _filbuf() 
  1521. is some undefined but large value so a lot of memory will be overwritten.  In
  1522. my case the string was on the stack so my stack was wiped.
  1523.  
  1524. In short if you configure your kernel to have NOFILES > _NFILE ie more than
  1525. the default then sscanf() is a time bomb in your code."
  1526.  
  1527. This is alleged to have been fixed in SVr4, but I haven't been able to
  1528. confirm the fix.  Bob Tinsmamn of SCO support writes: "We're fixing it
  1529. too, in a maintenance supplement to the Development System that will
  1530. come out at the end of this year or the beginning of 1993, known as
  1531. Development System Maintenance Supplement 4.2 or MSD 4.2."
  1532.  
  1533. 7. shmat(2) vs. vfork(2)
  1534.    The shmat(2) call is known to interact bady with vfork(2).  Specifically,
  1535. if you attach a shared-memory segment, vfork(), and then the child releases
  1536. the segment, the parent loses it too!  Workaround; use fork(2).
  1537.    UHC and Microport both suspect that they still have this bug and opine that
  1538. anyone who uses vfork deserves to lose.  Dell has no plans to fix it.
  1539.  
  1540.    John Sully <jms@mport.com> writes: "This is not a bug.  It is completely
  1541. consistent with the semantics of a change to the address space of the child.
  1542. Think about it: any change to the address space of a child process created by
  1543. vfork(2) is reflected in the parent since the child is actually executing in
  1544. the parent's address space.  Therefore if the child changes the address space
  1545. (in this case by releasing the shared memory segment) what should happen?
  1546. Right, the parent should have the same change happen.  And what does happen?
  1547. The segment is released in the parent.  One can argue about the braindead
  1548. semantics of vfork(2) all day, but the fact remains that this is exactly what
  1549. one would expect to happen.  To quote from the manual page:
  1550.  
  1551.      [...] vfork differs  from fork  in
  1552.      that the    child  borrows    the parent's *memory* and thread of
  1553.      control until a call to execve or an exit (either by a  call
  1554.      to     exit  or  abnormally.) [ emphasis added ]
  1555.  
  1556. and later:
  1557.  
  1558.      It does not work, however, to return while
  1559.      running in    the child's  context  from  the     procedure  which
  1560.      called vfork since    the eventual return from vfork would then
  1561.      return to a no longer existent  stack  frame.
  1562.  
  1563. Please note that the entire address space of the parent is used by
  1564. the child created by vfork(2).  The manual page also points out
  1565. several other caveats involved in doing anything to the parent's
  1566. address space except successfully calling an exec family function or
  1567. _exit (note it specifically says *not* to call exit(2)).  I do not believe 
  1568. that having a shared memory segment disappear from the parent's address 
  1569. space is out of line after reading the man page for vfork(2).
  1570.  
  1571. It is interesting to note that Sun after implementing its new VM system in
  1572. SunOS 4.0 initially had no plans to support vfork, since they felt that the COW
  1573. semantics of the new fork would provide the necessary efficiency gain.  Indeed
  1574. they found that most programs which used vfork worked just fine by doing
  1575. -Dvfork=fork.  All that is, except for a certain popular command interpreter
  1576. [ed: can you say C shell?].  So we are stuck with the legacy of this braindead
  1577. system call.
  1578.  
  1579. BTW, Microport has no plans to fix this :-)."
  1580.  
  1581. 8. FIONREAD fails on regular files
  1582.   Christoph Badura <bad@generics.ka.sub.org> reports that the FIONREAD ioctl()
  1583. fails on regular (disk) files.  He has sent USL a one-line kernel fix.
  1584.  
  1585. 12. fread(3) does the wrong thing on pipes and FIFOs
  1586.    Ed Hall <edhall@rand.org> writes: "Unlike the raw read() system call,
  1587. fread() is supposed to be able to make several partial reads to satisfy the
  1588. data requested by its arguments.  The exceptions are an EOF or an error on the
  1589. stream.  This characteristic is quite useful when moving data through pipes or
  1590. over network connections, since partial reads are quite common in these cases.
  1591. Well, the version of fread() in ESIX 4.0.3 (and likely other Sys5R4's) only
  1592. does a single physical read, and if it only satifies part of the requested
  1593. number of bytes, that's all you get.  This can sting you even if you carefully
  1594. check the value returned by fread(), since the value returned is rounded down
  1595. to the number of complete "nitems" read, although your position in the stream
  1596. can be up to size-1 bytes beyond that point.  Neither ferror() nor feof()
  1597. indicate anything is wrong when this happens."
  1598.    This bug (which is also present in 4.0.4) is serious and nasty and should
  1599. be high on every porting house's list to fix.  It appears to be peculiar to
  1600. USL 4.0.3 and 4.0.4; 4.0.2 does *not* have it, nor does SCO.
  1601.    A USL source claims it has been fixed in 4.1.
  1602.  
  1603. 10. putw appears to be broken
  1604.    There is a bug in the ESIX SVR4.0.3A putw() routine in the C shared
  1605. library which is probably USL's.  The following program demonstrates
  1606. it:
  1607.  
  1608. /* compile with: cc -o file file.c */
  1609. #include <stdio.h>
  1610. main()
  1611. {
  1612.     int i;
  1613.     for (i=0; i<1022; ++i) {
  1614.         putchar('1');
  1615.     }
  1616.     putw(-11, stdout);
  1617.     for (i=0; i<1022; ++i) {
  1618.         putchar('1');
  1619.     }
  1620. }
  1621.  
  1622. The putw() routine does not output 4 bytes, as it should.  It may be
  1623. there is some interaction with buffer flushing that is causing the
  1624. problem.  Also, note that if you change the sign of the first argument
  1625. to putw(), the program works fine.
  1626.  
  1627. 11. Compiler problems
  1628.    Ronald Guilmette <rfg@ncd.com> also reports the following:
  1629.  
  1630. ------------------------------------------------------------------------------
  1631. /* Here is a bug in the original SVR4 C compiler (aka C Issue 5) which
  1632.    effectively prevents you from making good use of the `const' and
  1633.    `volatile' qualifiers defined by ANSI C in conjunction with pointer
  1634.    types and typedef statements.  Compile this code and you will get:
  1635.  
  1636.    "qualifiers.c", line 23: left operand must be modifiable lvalue: op "="
  1637.  
  1638.    ...if your copy of the svr4 C compiler still has the bug.  Note that
  1639.    given these declarations, the ANSI C standard say that the thing pointed
  1640.    to by the variable `pci' should be considered to be constant... not the
  1641.    variable `pci' itself.  (The GCC compiler, either version 1.x or version
  1642.    2.x, correctly compiles this example without complaint.)
  1643. */
  1644.  
  1645. typedef const int *ptr_to_const_int;
  1646.  
  1647. ptr_to_const_int pci;
  1648.  
  1649. int i;
  1650.  
  1651. void main ()
  1652. {
  1653.   pci = &i;
  1654. }
  1655. ------------------------------------------------------------------------------
  1656. /* Here is a subtle bug in the original SVR4 C compiler (aka C Issue 5)
  1657.    which prevents you from first declaring a tagged type (i.e. a struct
  1658.    type or a union type) in a parameter list, and then defining that tagged
  1659.    type later on within the same scope.  (Note that according to the ANSI C
  1660.    standard, the scope in which parameters get declared and the outermost
  1661.    block of a function body are one and the same scope.  Thus, this really
  1662.    is legal ANSI C code!)
  1663.  
  1664.    Try compiling this with your C compiler on SVR4.  If your compiler still
  1665.    has the bug, you will get:
  1666.  
  1667.    "tagged_type.c", line 24: warning: dubious tag declaration: struct S
  1668.    "tagged_type.c", line 28: warning: improper member use: i
  1669.    "tagged_type.c", line 28: warning: improper member use: i
  1670.    "tagged_type.c", line 31: warning: dubious tag declaration: struct S
  1671.    "tagged_type.c", line 35: warning: improper member use: i
  1672.    "tagged_type.c", line 35: warning: improper member use: i
  1673.  
  1674.    (The GCC compiler also had this bug in version 1.x, but it has been fixed
  1675.    in version 2.x.)
  1676. */
  1677.  
  1678. void foobar1 (arg)        /* use old-style without prototypes */
  1679.     struct S *arg;
  1680. {
  1681.   struct S { int i; };        /* define the type `struct S' */
  1682.  
  1683.   arg->i = arg->i;        /* legal according to ANSI C rules! */
  1684. }
  1685.  
  1686. void foobar2 (struct S *arg)    /* use new-style with prototypes */
  1687. {
  1688.   struct S { int i; };        /* define the type `struct S' */
  1689.  
  1690.   arg->i = arg->i;        /* legal according to ANSI C rules! */
  1691. }
  1692. ------------------------------------------------------------------------------
  1693. /* Here is a serious bug in the original SVR4 `dump' program which dumps
  1694.    out parts of object files in either plain hex form or symbolically.
  1695.  
  1696.    To see the `dump' program get a segfault and die, save this code under
  1697.    the name `dump-bug.c' and then do:
  1698.  
  1699.     cc -g -c dump-bug.c
  1700.     dump -v -D dump-bug.o
  1701.  
  1702.    The bug arises whenever `dump' tries to read Dwarf debugging information
  1703.    for an array of pointers to any "user defined" type (e.g. `struct S' in
  1704.    this example).  Past that point, `dump' is totally confused, so further
  1705.    Dwarf debugging information finally causes it to go belly-up.
  1706. */
  1707.  
  1708. struct S { int i; };
  1709. struct S *array[10];
  1710. int j;
  1711. ------------------------------------------------------------------------------
  1712. It appears that the svr4 C compiler (for x86 machines) doesn't conform real
  1713. well to either the letter or the spirit of the IEEE 754 floating-point
  1714. standard.  In particular, "unordered comparisons" and other operations on
  1715. NaNs don't always produce the result that that the IEEE 754 standard calls
  1716. for.
  1717.  
  1718. An AT&T source comments: "This is documented in the SVID as a future direction.
  1719. We do not support NaNs in -Xa and -Xt modes, only in -Xc.  Try
  1720. isnan(sqrt(-1.0)) to determine which modes support it."
  1721. ------------------------------------------------------------------------------
  1722.  
  1723. The compiler fails to issue diagnostics in cases where a typedef name is
  1724. reused to declare a formal parameter, as in:
  1725.  
  1726. -----------------------------------------------------------------------
  1727. typedef int FOO;
  1728. void bar (FOO)
  1729.     int FOO;
  1730. {
  1731. }
  1732. -----------------------------------------------------------------------
  1733.  
  1734. The compiler crashes on the following invalid input:
  1735.  
  1736. -----------------------------------------------------------------------
  1737. int i;
  1738. volatile void *pvv;
  1739.  
  1740. void pvv_test ()
  1741. {
  1742.   (i ? *pvv : *pvv);    /* ERROR */
  1743. }
  1744. -----------------------------------------------------------------------
  1745.  
  1746. The compiler fails to issue diagnostics for cases where an attempt is
  1747. made to "forward declare" an enum type (without also defining it), as
  1748. in:
  1749.  
  1750. -----------------------------------------------------------------------
  1751. enum enum0 *ep;       /* ERROR */
  1752. -----------------------------------------------------------------------
  1753.  
  1754. The compiler rejects the following code with an error, although there
  1755. seems to be no good reason why it should (because no object is being
  1756. declared).
  1757.  
  1758. -----------------------------------------------------------------------
  1759. #include <limits.h>
  1760.  
  1761. typedef char array_type[ULONG_MAX];
  1762. -----------------------------------------------------------------------
  1763.  
  1764. 12. getlogin() doesn't work
  1765.    Robert Withrow <witr@rwwa.com> reports "The posix function
  1766. getlogin() doesn't work on most svr4s (at least up to SVR4.0.3.0...
  1767. cuserid() *does* work, but it makes porting a pain.  Try it some time
  1768. and perhaps add it to your list."
  1769.    Raymond Nijssen  <raymond@woensel.es.ele.tue.nl> confirms this and
  1770. adds that this bug (due to utmp and wtmp file corruptions [possibly
  1771. caused by ttymon bugs described above --- ed.]) breaks executables such
  1772. as talk(1).
  1773.  
  1774. 13. syslog routines don't work
  1775.    Raymond Nijssen <raymond@woensel.es.ele.tue.nl> reports: "Under ESIX 4.0.3,
  1776. syslog routines are unusable. They are slightly better under 4.0.4, but still
  1777. severely broken."
  1778.    "In addition, replacing the syslogd executable that comes with Esix with the
  1779. one provided by Marc Boucher (marc@cam.org) shows that the syslog() call itself
  1780. is sane. It's available from ftp.cam.org."
  1781.  
  1782. 14. Bogus `r' in xt driver configuration flags
  1783.    Raymond Nijssen <raymond@woensel.es.ele.tue.nl> reports: "Both under ESIX
  1784. 4.0.3 and 4.0.4, the `r' flag is present in the third column of
  1785. /etc/conf/cf.d/mdevice for the [n][s]xt drivers, suggesting that these drivers
  1786. would be required for relinking the kernel. This is not the case. I saw at
  1787. least one release of Dell SVR4 in which this was ok."  (Making this change
  1788. reduces the kernel's size somewhat.)
  1789.  
  1790. 15. ioctl for kernel symbol fetches fails
  1791. Trying to obtain kernel values of certain symbols fails.  The 
  1792. two symbols from the kernel that are quite useful are "avenrun" and
  1793. "total" which as far as I can tell are defined in the "mm" driver.
  1794. This bug manifests itself in applications like "top", "u386mon" ...
  1795. One used to use the nlist() function call, but according to the man page
  1796. for nlist() it should not be used due to the dynamic loading and unloading
  1797. of drivers that can happen at any time in the "life" of a V.4.2 kernel.
  1798.  
  1799. Try the sample hack below to see if your system has the same problem.
  1800.  
  1801. #include <sys/types.h>
  1802. #include <sys/stat.h>
  1803. #include <fcntl.h>
  1804. #include <sys/ksym.h>
  1805.  
  1806. main()
  1807. {
  1808.     int fd=0;
  1809.     long ar[3];
  1810.     struct mioc_rksym k;
  1811.  
  1812.     fd = open("/dev/kmem", O_RDONLY);
  1813.     k.mirk_buflen = sizeof(ar);
  1814.     k.mirk_buf = (void *)&ar;
  1815.     k.mirk_symname = "avenrun";
  1816.     if((ioctl(fd, MIOC_READKSYM, &k))==-1)    {
  1817.         perror("ioctl");
  1818.         exit(1);
  1819.     }
  1820.     printf("%d %d %d\n",ar[0],ar[1],ar[2]);
  1821.     close(fd);
  1822. }
  1823.  
  1824. Thanks to David P. Cutter <dpc@shady.grail.com> for reporting this.
  1825.  
  1826. 16. Bug in cc optimizer (4.2.1)
  1827.  
  1828.    Nickolay Saukh <nms@ussr.eu.net> reports a bug in
  1829. cc, the Optimizing C Compilation System  (CCS) 2.0  07/24/92 
  1830.  
  1831. If you have global (external) structure/union with name 'tr'
  1832. commands to access very first member (with zero offset) are
  1833. garbled. Simple text to reproduce the bug
  1834.  
  1835.     struct _tr {
  1836.         int    aa;
  1837.         int    bb;
  1838.     } tr;
  1839.  
  1840.     void
  1841.     foo(int zz) {
  1842.         tr.aa = zz;
  1843.     }
  1844.  
  1845. Here is the result of cc -O -S foo.c
  1846.  
  1847.     .file    "ccbug.c"
  1848.     .version    "01.01"
  1849.     .type    foo,@function
  1850.     .text
  1851.     .globl    foo
  1852.     .align    4
  1853.  
  1854.     .nopsets    "cc"
  1855.     .align    16
  1856. foo:
  1857.     movl    4(%esp),%eax
  1858.     movl    %eax,&r
  1859.              ^------------- <<<< THE BUG
  1860.     ret    
  1861.     .align    16,7,4
  1862.     .size    foo,.-foo
  1863.     .ident    "acomp: (CCS) 2.0  07/24/92 "
  1864.     .data
  1865.     .comm    tr,8,4
  1866.     .text
  1867.     .ident    "optim: (CCS) 2.0  07/24/92 "
  1868.  
  1869. **  17. /usr/ucb/install uses missing group "staff"
  1870.    /usr/ucb/install uses the group name "staff" as the default group to install
  1871. programs. As this group does not exist in /etc/group, the installation will
  1872. fail.  I would suggest changing the /etc/group file like in Solaris as follows:
  1873.  
  1874.         nuucp::9:root,nuucp
  1875.         staff::10:
  1876.  
  1877. VII. The FUBYTE Problem
  1878.  
  1879. (Thanks to Christoph Badura <bad@flatlin.ka.sub.org> for this info)
  1880.  
  1881. The kernel function fubyte() is documented to return a positive value when
  1882. given a valid user space address and -1 otherwise. In the latter case u.u_error
  1883. is set to EFAULT.  USL SysV R4.0.3 has a sign extension bug in the
  1884. implementation of fubyte() for local file descriptors (i.e. not opened via
  1885. RFS), which causes fubyte() to return negative values if the byte fetched has
  1886. its high bit set. This bug doesn't affect STREAMS drivers, as they don't call
  1887. (and in fact are normally unable to call) fubyte().  Thus writing a byte with
  1888. the high bit set to certain character device drivers returns with -1 and errno
  1889. set to EFAULT.
  1890.  
  1891. The bug may affect any character device driver that calls fubyte(). It's not
  1892. limited to serial card drivers. The bug is noticed most often with serial card
  1893. drivers, since uucp uses byte values > 127 very early during g-protocol setup
  1894. and drivers for serial cards tend to use fubyte() quite often.
  1895.  
  1896. Note also that the bug's effect is different if the driver checks for a -1
  1897. return value of fubyte() or just a negative one. In the former case it is
  1898. possible to pass bytes with the 8 bit set through fubyte(), except for 0xff
  1899. which is -1 in two's complement. That makes the bug more obscure.
  1900.  
  1901. The fix is easy.  First, make a backup copy of the kernel object file
  1902. /etc/conf/pack.d/kernel/vm.o!  A disassembly of vm.o(lfubyte) should reveal
  1903. *exactly* one mov[s]bl (move byte to long w/sign extend).  That one needs to be
  1904. patched into a movzbl (zero extend). The difference is one bit in the second
  1905. byte of the opcode.
  1906.  
  1907. The movsbl has the bit pattern 00001111 1011111w mod/rm-byte.
  1908. The movzbl has the bit pattern 00001111 1011011w mod/rm-byte.
  1909.  
  1910. The 'w' bit is 0 for the instruction in question. So the opcodes are 0f be and
  1911. 0f b6. Here is the diff -c from dis -F lfubyte showing the patch applied to
  1912. the Dell 2.1 kernel:
  1913.  
  1914. *** vm.o    Mon Mar  9 00:31:38 1992
  1915. --- vm.o.org    Mon Mar  9 00:32:40 1992
  1916. ***************
  1917. *** 22,28 ****
  1918.       11c90:  85 c0                 testl  %eax,%eax
  1919.       11c92:  75 09                 jne    0x9 <11c9d>
  1920.       11c94:  8b 45 08              movl   8(%ebp),%eax
  1921. !     11c97:  0f b6 00              movzbl (%eax),%eax
  1922.       11c9a:  89 45 fc              movl   %eax,-4(%ebp)
  1923.       11c9d:  c7 05 d8 13 00 00 00 00 00 00 movl   $0x0,0x13d8
  1924.       11ca7:  83 3d dc 13 00 00 00  cmpl   $0x0,0x13dc
  1925. --- 22,28 ----
  1926.       11c90:  85 c0                 testl  %eax,%eax
  1927.       11c92:  75 09                 jne    0x9 <11c9d>
  1928.       11c94:  8b 45 08              movl   8(%ebp),%eax
  1929. !     11c97:  0f be 00              movsbl (%eax),%eax
  1930.       11c9a:  89 45 fc              movl   %eax,-4(%ebp)
  1931.       11c9d:  c7 05 d8 13 00 00 00 00 00 00 movl   $0x0,0x13d8
  1932.       11ca7:  83 3d dc 13 00 00 00  cmpl   $0x0,0x13dc
  1933.  
  1934. Of course there is a workaround at the driver level.  Canonically, one would do
  1935. this by checking for fubyte() returning -1 *and* u.u_error being set to EFAULT
  1936. (u.u_error is cleared upon entering a system call).  However, in R4.0.3
  1937. fubyte() does NOT set u.u_error.  It *does* set u.u_fault_catch.fc_errno.
  1938.  
  1939. Cristoph reports that Dell 2.1 can be object-patched successfully to fix this.
  1940. I'm told that the offending 11c97 is at exactly the same address in the
  1941. Consensys 1.3 kernel.  
  1942.  
  1943. At vm.o:fa7d in Dell 2.2 there's a movzbl (%edx),%edx; same instruction,
  1944. different target register.  Here's the relevant diff output:
  1945.  
  1946. *** vm.o-old    Wed Jul  7 03:13:11 1993
  1947. --- vm.o    Wed Jul  7 03:13:00 1993
  1948. ***************
  1949. *** 25,31 ****
  1950.         fa76:  85 c0                  testl  %eax,%eax
  1951.         fa78:  75 09                  jne    0x9 <fa83>
  1952.         fa7a:  8b 55 08               movl   8(%ebp),%edx
  1953. !       fa7d:  0f b6 12               movzbl (%edx),%edx
  1954.         fa80:  89 55 fc               movl   %edx,-4(%ebp)
  1955.         fa83:  c7 05 d8 13 00 00 00 00 00 00 movl   $0x0,0x13d8
  1956.         fa8d:  83 3d dc 13 00 00 00   cmpl   $0x0,0x13dc
  1957. --- 25,31 ----
  1958.         fa76:  85 c0                  testl  %eax,%eax
  1959.         fa78:  75 09                  jne    0x9 <fa83>
  1960.         fa7a:  8b 55 08               movl   8(%ebp),%edx
  1961. !       fa7d:  0f be 12               movsbl (%edx),%edx
  1962.         fa80:  89 55 fc               movl   %edx,-4(%ebp)
  1963.         fa83:  c7 05 d8 13 00 00 00 00 00 00 movl   $0x0,0x13d8
  1964.         fa8d:  83 3d dc 13 00 00 00   cmpl   $0x0,0x13dc
  1965.  
  1966. Applying this patch produces a working kernel.
  1967.  
  1968. I do not know the status of the other ports.
  1969.  
  1970. Another poster (Marc Boucher <marc@cam.org>) adds:
  1971.  
  1972. On ESIX SVR4.0.3 Rev. A, the instruction movsbl in question can be changed to
  1973. movzbl (as described above) with a binary-editor on file
  1974. /etc/conf/pack.d/kernel/vm.o. At offset 0x11eb0, change 0xbe to 0xb6.
  1975.  
  1976. Before patching, verify that your /etc/conf/pack.d/kernel/vm.o is the same as
  1977. mine!  On my system, the /bin/sum generated checksum of vm.o was "4440 222".
  1978.  
  1979. The problem results from a sign-extension bug.  The function lfubyte(), which
  1980. is called by fubyte(), is declared as
  1981.  
  1982. int lfubyte(char *addr);    /* actually caddr_t */
  1983.  
  1984. The byte is fetched with
  1985.  
  1986.     val = *addr;
  1987.  
  1988. which triggers sign extension.  Casting addr to a unsigned char * or declaring
  1989. it as such solves the problem.
  1990.  
  1991. This bug is still present in stock USL 4.0.4.  However, it has been fixed in
  1992. Dell 2.2.
  1993.  
  1994. Raymond Nijssen contributes the following:
  1995.  
  1996. ---- README --------------------------------------------------------------->8--
  1997. This shell script was written to help out people who are less experienced in
  1998. patching kernel binaries.
  1999. This version can be used to fix the fubyte bug in follwing SVR4 flavors:
  2000.  
  2001.     ESIX 4.0.3A
  2002.     ESIX 4.0.4
  2003.     Dell 2.1
  2004.     Consensys 1.3
  2005.  
  2006. You need sdb and your system has to be able to rebuild the kernel. 
  2007.  
  2008. After the patch is applied, you have to rebuild the kernel by running
  2009. /etc/conf/bin/idbuild and /etc/conf/bin/idreboot for the patch to take effect.
  2010.  
  2011. You have to be root to do all this.
  2012. The program will ask for your confirmation before it changes anything.
  2013.  
  2014. Please do make a backup first, and remember that you can select the old kernel
  2015. (/stand/unix.old) at boot time by pressing the space bar at the 'Booting the
  2016. ESIX system....' prompt, in case the system fails to boot from the patched
  2017. kernel, though this is higly unlikely.
  2018.  
  2019. Systems to which this patch was applied have been running flawlessly
  2020. for several months, in case you have doubts...
  2021.  
  2022. Happy patching!
  2023. --------------------------------------------------------------------------->8--
  2024.  
  2025. ----- fbfix --------------------------------------------------------------->8--
  2026. #!/bin/sh
  2027. #
  2028. #    Copyright (c) 1993  Raymond X.T. Nijssen  (raymond@woensel.es.ele.tue.nl)
  2029. #               All Rights Reserved
  2030. #
  2031.  
  2032. # the bug...
  2033. #
  2034. b=fubyte
  2035.  
  2036. # offsets according to flakey USL sdb.  gdb and dis say something different
  2037. esix403_o=0x11eb0
  2038. esix404_o=0x11683  
  2039. dell21_o=0x11c98    #dell 2.1
  2040. cons13_o=$dell21_o  #consensys 1.3
  2041.  
  2042. # data
  2043. v=0x458900be #old 
  2044. r=0x458900b6 #new
  2045.  
  2046. # file
  2047. f=/etc/conf/pack.d/kernel/vm.o
  2048.  
  2049. # progs
  2050. s=/usr/ccs/bin/sdb
  2051. i=/etc/conf/bin/idbuild
  2052.  
  2053. c='\c';t='\t';n='\n';N=/dev/null
  2054.  
  2055. # aux
  2056. pe() if [ -n "$e" ];then echo ${n}ERROR: $e $n;e="";fi
  2057. yn() { while :;do echo $n$1 [$2] $c;read a;if [ -z "$a" ];then a=$2;fi
  2058.  case "$a" in y*)return 0;;n*)return 1;;*)echo Answer 'y' or 'n';;esac;done;}
  2059. cr() if id|grep "^uid=0">$N;then return 0
  2060.  else e="Only root may patch the kernel";return 1;fi
  2061. ab() { echo ${n}FATAL: $e$n;exit 1;}
  2062. ac() { pe;yn "Continue ?" "y";return;}
  2063. qu() { R="";if [ -n "$1" ];then d="[$1] :";else d=":";fi
  2064.  while [ -z "$R" ];do echo ${n}Enter the $2 $d $c;read a
  2065.   if [ "$a" ];then R=$a;elif [ -n "$1" ];then R=$1;
  2066.   else e="No $2 entered";ac||exit 0;fi;done;}
  2067.  
  2068.  
  2069. # main
  2070. if [ ! -t 0 ];then e="This program must not be piped into a shell";ab;fi
  2071. if [ ! -f $s ];then e="$s not found";ab;fi
  2072. if [ ! -f $f ];then e="$f not found";ab;fi
  2073. if [ ! -f $i ];then e="$i not found";ab;fi
  2074.  
  2075. echo $n$n${t}YOU are responsible for running this program.$n$n${t}Clauses 9 and 10 of the GNU GENERAL PUBLIC LICENSE$n${t}apply to this program.$n$n${t}If you continue, you thereby agree that its author, $n${t}nor his employer, nor anybody else except yourself, has any $n${t}liablity for any loss, damage etc. etc.$n
  2076.  
  2077. ac||exit 1
  2078.  
  2079. echo $n$n${t}Fixable versions with the $b bug$n$n$t$t[1]$t ESIX 4.0.3A$n$t$t[2]$t ESIX 4.0.4$n$t$t[3]$t DELL 2.1$n$t$t[4]$t Consensys 1.3$n
  2080. R=1;qu "$R" "SVR4 flavor this system is running"
  2081. case $R in 1)o=$esix403_o;; 2)o=$esix404_o;;3)o=$dell21_o;; 4)o=$cons13_o;;
  2082.  *)e="Invalid answer";ab;;esac
  2083.  
  2084. echo $n${t}Looking for replacement target ... $c
  2085. if echo $o:?lx|$s -e $f 2>$N|grep $o/$v>$N;then echo found
  2086.  if yn "Do you want to patch the kernel now?" "n";then
  2087.   cr||ab
  2088.   qu "$f.orig" "name of backup file"
  2089.   if [ -f $R ];then e="File $R already exists";ab;fi
  2090.   if cp $f $R;then echo $n${t}Copied $f to $R;else e="Failed to write $R";ab;fi
  2091.   if echo $o!$r|$s -e -w $f>$N 2>&1;then
  2092.    echo ${n}Fixed $b bug, you may now run $i and reboot$n;else e="$s failed";pe
  2093.    if cp $R $f;then echo $n${t}Copied $R to $f;else e="Restore $f failed";pe;fi
  2094.    e="Patch failed!!";ab;fi
  2095.  fi
  2096. else echo not found;e="Replacement target not found at expected offset";ab;fi
  2097. --------------------------------------------------------------------------->8--
  2098.  
  2099. VIII. Destiny and Dell
  2100.  
  2101. A source at at UNIX System Labs Europe claims that `Destiny' (the new Release
  2102. 4.2) incorporates all of Dell UNIX's fixes to 4.0.3; thus, any bug for which a
  2103. Dell fix is indicated above should be gone in Destiny.
  2104. --
  2105.     Send your feedback to: Eric Raymond = esr@snark.thyrsus.com
  2106.  
  2107.